Oracle 中自带函数wm_concat排序
在wm_concat 连接字符串时发现有时不会按你要求的排序
比如 一个表test有字段 id,name ,product ,num
select name ,(select wm_concat( product'('||tot_num')')
from ( select name ,product ,sum(num) tot_num, row_number() over (partition by name order by sum(num) desc ) as rn
from test group by name ,product ) m where rn