源数据
1.用wm_concat查询
select to_char(wm_concat(pmn24)),to_char(wm_concat(pmn04))
from pmn_file where pmn01=‘PO1-A2012010001’
2.用LISTAGG 查询
select pmn24, LISTAGG( to_char(pmn04), ‘|’) WITHIN GROUP(ORDER BY pmn04)
from (select distinct pmn24,pmn04 from pmn_file where pmn01=‘PO1-A2012010001’)
group by pmn24
差异分析:wm_concat(列名),他把列值用“,”分隔开,而且是显示成一行
LISTAGG(列名,’ 分割符号’),用 指定的分割符号 合并成一行显示