日期:2014-05-18  浏览次数:20465 次

大神帮忙看一下这个查询语句要怎么写
SELECT *
FROM REALBASE201207
WHERE (SID = 3) order by time
查询结果如下


SID PID vlaue time
3 1 1 2012-07-22 12:55:00.310
3 2 3 2012-07-22 12:55:00.310
3 3 1 2012-07-22 12:55:00.310
3 4 2 2012-07-22 12:55:00.310
3 5 2 2012-07-22 12:55:00.310
3 1 1 2012-07-22 13:15:00.343
3 2 4 2012-07-22 13:15:00.343
3 3 1 2012-07-22 13:15:00.343
3 4 20 2012-07-22 13:15:00.343
3 5 2 2012-07-22 13:15:00.343
3 1 12 2012-07-22 13:25:00.373
3 2 42 2012-07-22 13:25:00.373
3 3 12 2012-07-22 13:25:00.373
3 4 22 2012-07-22 13:25:00.373
3 5 11 2012-07-22 13:25:00.373

现在我想要的表如下:
time 1 2 3 4 5
2012-07-22 12:55:00.310 1 3 1 2 2
2012-07-22 13:15:00.343 1 4 1 20 2
2012-07-22 13:25:00.373 12 42 12 22 11
想了好久没想出来,大神们帮我想想要怎么写


------解决方案--------------------
参考:
http://blog.csdn.net/ajaxchen_615/article/details/3941856

动态,静态的都有...