重複の可能性:
MySQL ピボット行を動的な数の列に
1 日あたりのアイテム数を表示するクエリがあります
$query = "SELECT uploadedby, count(item) as item, date_format(uploaddate, '%m-%d-%y') as date FROM `imsexport` GROUP BY uploadedby,date";
$result = mysql_query($query);
結果のテーブルは次のようになります
Name item date
Abel Antonio 10 01-02-12
Abel Antonio 5 01-03-12
Abel Antonio 6 01-04-12
Abel Antonio 2 01-05-12
Abel Antonio 1 01-09-12
Abel Antonio 15 01-12-12
Abel Antonio 22 01-16-12
Abel Antonio 15 01-17-12
Abel Antonio 7 01-19-12
Abel Antonio 45 02-15-12
Abel Antonio 31 02-16-12
...other names
クエリを次のようにするために、日付を列として作成したいと思います
Name 01-02-12 01-03-12 01-04-12 01-05-12 01-09-12 ....
Abel Antonio 10 5 6 2 1 .....
これを達成する方法を知っている人はいますか?