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
阅读(1889) | 评论(0) | 转发(0) |