select name,ltrim(max(sys_connect_by_path(string,',')),',') as string
from (
select name,string,
rank()over(order by name) + row_number()over(order by name) RN,
row_number()over(partition by name order by name) RM
from aaa
)
start with RM=1
connect by prior RN=RN-1
group by name
string 是你要合并的字符串字段 还是建议用存储过程实现 ...