U kunt deze zoekopdracht gebruiken -
SELECT
supplier_id,
MAX(IF(date = '2012-01-01', value, NULL)) AS '2012-01-01',
MAX(IF(date = '2012-01-03', value, NULL)) AS '2012-01-03',
MAX(IF(date = '2012-05-01', value, NULL)) AS '2012-05-01'
FROM (
SELECT supplier_id, DATE(date) date, CONCAT(SUM(price), '(', qty, ')') value FROM supplier
GROUP BY supplier_id, DATE(date)
) t
GROUP BY supplier_id;
+-------------+------------+------------+------------+
| supplier_id | 2012-01-01 | 2012-01-03 | 2012-05-01 |
+-------------+------------+------------+------------+
| 1 | 500.00(2) | 450.00(10) | NULL |
| 2 | 400.00(5) | NULL | NULL |
| 3 | NULL | NULL | 500.00(1) |
+-------------+------------+------------+------------+
Het levert het gewenste resultaat op. Maar als je het dynamisch wilt doen, bekijk dan dit artikel 'Automatiseer draaitabelquery's' - http://www.artfulsoftware.com/infotree/queries.php#523 , of deze link - Dynamische draaitabellen .