我遇到以下问题
我有一张这样的桌子
+------+---------+------------+
| imei | channel | sys_date |
+------+---------+------------+
| 1111 |unknown01| 2013-04-15 |
| 2222 |unknown02| 2013-04-15 |
| 3333 |unknown03| 2013-04-15 |
| 4444 |unknown01| 2013-04-16 |
| 5555 |unknown02| 2013-04-17 |
| 6666 |unknown02| 2013-04-17 |
+------+---------+------------+
现在我需要写一个这样的 SQL 让结果(让通道的值作为额外的列)
+----------+---------+---------+---------+
| sys_date |unknown01|unknown02|unknown03|
+----------+---------+---------+---------+
|2013-04-15| 1 | 1 | 1 |
|2013-04-16| 1 | 0 | 0 |
|2013-04-17| 0 | 2 | 0 |
+----------+---------+---------+---------+
我不知道这个sql,所以我需要帮助,谢谢