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
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 ;;
效果图: