select
count(*)ct,
trim(both ',' from sys.stragg(distinct to_char(T.FID) || nvl2(T.FID, ',',''))) d
from CP_ORDERLIFEHELP T group by T.FWORKERID
结果: ct d
1 23
2 33,55
5 666,777,333,444,23423
select
count(*)ct,
trim(both ',' from sys.stragg(distinct to_char(T.FID) || nvl2(T.FID, ',',''))) d
from CP_ORDERLIFEHELP T group by T.FWORKERID
结果: ct d
1 23
2 33,55
5 666,777,333,444,23423
转载于:https://my.oschina.net/u/2613034/blog/756110