用sql实现未知个数字符的拼接--(转)
原表id name-----------aa high1bb high1cc high2dd high3ee high3ff high3...目标id name-----------------aabb high1cc high2ddeeff high3程序如下:select replace(MAX(SYS_CONNECT_BY_PATH(id, ',')), ',', '') id, name from (select id, name, row_number() over(partition by name order by rownum) rn from test)START WITH rn = 1CONNECT BY PRIOR rn + 1 = rn AND PRIOR name = namegroup by name;START WITH 代