oracle 拼接某个字段的全部值

来源:互联网 发布:python 定义字典 编辑:程序博客网 时间:2024/05/14 08:04
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 ;;

效果图:

1  L/C投保客户扣减2’;制裁客户扣减4';战争客户扣减6’;正常

原创粉丝点击