有时候我们需要将字段为 1,4,5,6这样的数据转换为行
在oracle中我们可以通过如下方式实现
select * from ( with temp as (select EQ_YJLY text from SF_EQ_CERS_INFO where eq_id='20121744') 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 )) inner join basis_yjly on ly_code=text
爆款云服务器s6 2核4G 低至0.46/天,具体规则查看活动详情