将行变成列SQL

 

--单行 with temp as (select '6001600301,6001600302,6001600303,6001600304' text from dual) select substr(text,instr(text,',',1,rn)+1,instr(text,',',1,rn+1)-instr(text,',',1,rn)-1) text from ( select ','||t1.text||',' text,t2.rn from temp t1, (select rownum rn from all_objects where rownum <= (select length(text)-length(replace(text,',',''))+1 from temp)) t2 )

posted on 2012-10-30 09:14  kenwong  阅读(154)  评论(0)    收藏  举报

导航