oracle 拼接某个字段的所有值

来源:互联网 发布:数据连接器 编辑:程序博客网 时间:2024/05/23 01:16
select stastep from i_cre_risk_csdetail where iflag=1 and plan_id=1 and  parentid=7;
select plan_id, ltrim(max(sys_connect_by_path(stastep, ';')), ';') from 
(
select plan_id,stastep,rownum as rn
from i_cre_risk_csdetail where iflag=1 and plan_id=1 and  parentid=7)
start with rn=1
connect by prior rn=rn-1 and prior plan_id=plan_id


group by plan_id


order by plan_id ;;

效果图:

原创粉丝点击