oracle按逗号分隔函数,Oracle按分组拼串逗号间隔

select pe_no,advice_groupno,advice_code,advice_class,bg_flagchar,WMSYS.WM_CONCAT(ITEM_CODE)

from(

SELECT a.PE_NO,

a.ADVICE_GROUPNO,

a.advice_code,

a.advice_class,

b.BG_FLAGCHAR,

b.item_code

FROM CPW_CODE_ADVICE a,CPW_CODE_ADVICE_ENTRY b

WHERE ( a.CPW_VER = b.CPW_VER ) and

( a.CPW_CODE = b.CPW_CODE ) and

( a.PE_NO = b.PE_NO ) and

( a.ADVICE_CODE = b.ADVICE_CODE ) and

( ( a.GROUP_SELECT_TYPE = '1' ) OR

( a.GROUP_SELECT_TYPE = '2' ))  AND

( a.CPW_VER = :n_cpw_ver ) AND

( a.CPW_CODE = :s_cpw_code ) AND

( a.PE_NO <= :n_pe_no ) and

( a.advice_class <> '11' and a.advice_class <> '12' )

order by a.ADVICE_GROUPNO,a.ADVICE_ROWNO,b.BG_FLAGCHAR,b.item_code

)

group by pe_no,advice_groupno,advice_code,advice_class,bg_flagchar

阅读(1446) | 评论(0) | 转发(0) |

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值