0
我在MySQL表中的数据格式如下如何根据数据中的条件填充mysql中的列?
id order_id state time_stamp
1 1 created 1:15 6/2/2015
2 2 created 1:17 6/2/2015
3 1 ack 1:18 6/2/2015
4 1 shipped 1:20 6/2/2015
5 1 delivered 1:25 6/2/2015
6 2 ack 1:25 6/2/2015
7 2 shipped 1:26 6/2/2015
8 2 delivered 1:29 6/2/2015
我要查询这个数据库得到的结果在下面的格式 -
order_id created_ts ack_ts shipped_ts delivered_ts
1 1:15 6/2/2015 1:18 6/2/2015 1:20 6/2/2015 1:25 6/2/2015
2 1:17 6/2/2015 1:25 6/2/2015 1:26 6/2/2015 1:29 6/2/2015
这是可以写为选择SQL查询?请帮助查询示例。 在此先感谢。