如何将查询结果纵向变成横向显示
表 温度监测 一小时一次
Date Time ID temperature
2013-01-01 00:00:00 1 20.7
2013-01-01 00:00:00 2 20.2
2013-01-01 00:01:00 1 19.9
2013-01-01 00:01:00 2 18.5
2013-01-01 00:02:00 1 21.2
2013-01-01 00:02:00 2 20
...
随着时间推移,数据越来越多
现在需要将查询结果这样显示
DATE ID temperatrue0 tempearture1 temperatrue2 ....
2013-01-01 1 20.7 19.9 21.2 ...
2013-01-01 2 20.2 18.5 20 ...
请问该如何写查询语句?