耗了个把小时
还是有些问题
[TEST1@orcl#2010-04-05 10:42:40] SQL>select name,
2 decode(substr(to_char(t9.time,'yyyy-mm-dd hh24:mi:ss'),-8),'08:00:00',time) time1,
3 decode(substr(to_char(t9.time,'yyyy-mm-dd hh24:mi:ss'),-8),'16:00:00',time) time2 from t9;
NAME TIME1 TIME2
---- ------------------- -------------------
a 2010-03-31 08:00:00
a 2010-03-31 16:00:00
a 2010-04-01 08:00:00
a 2010-04-01 16:00:00
b 2010-03-31 08:00:00
b 2010-03-31 16:00:00
看来普通的行转列方式还不行 期待高手改进下 如果用存储过程就简单了。。。
行转列就行了