我从这个查询的输出:是否可以将查询的输出转换为可能?
select Date,Status, count(distinct persons)from TableA where Date='2014-11-04' group by Status;
+------------+------------------------+-------------------------------+
| Date | Status | count(distinct persons) |
+------------+------------------------+-------------------------------+
| 2014-11-04 | 0 | 45 |
| 2014-11-04 | 1 | 93 |
+------------+------------------------+-------------------------------+
我想要得到的是:
+------------+------------------------+-------------------------------+
| Date | 0 | 1 |
+------------+------------------------+-------------------------------+
| 2014-11-04 | 45 | 93 |
+------------+------------------------+-------------------------------+
[MySQL数据透视表]可能的重复(http://stackoverflow.com/questions/7674786/mysql-pivot-table) – 2014-11-21 09:12:38