my query:
select Fimp_date, Fadpos, sum(Fplay_num) as Fplay_num from tbl_cnt_display_num_by_adpos where Fimp_date between date_format(now(),'%Y%m%d')-interval 2 day and date_format(now(),'%Y%m%d') group by Fadpos, Fimp_date;
and this is the result: +-----------+--------+-----------+
| Fimp_date | Fadpos | Fplay_num |
+-----------+--------+-----------+
| 20151020 | 0 | 1562156 |
| 20151020 | 1 | 19354 |
| 20151020 | 101 | 352796 |
| 20151020 | 102 | 232052 |
| 20151020 | 103 | 42324 |
| 20151020 | 104 | 214 |
| 20151020 | 105 | 167904 |
| 20151020 | 500 | 49 |
+-----------+--------+-----------+
how to write the sql let the result transform to:
it means that every day as a row, the diffrent Fadpos as diffrent columns and the value is the Fplay_num of the Fadpos on that day.
so how to write the sql?