1、基本语法
将多行同列合并展示为一行:LISTAGG(展示字段,分隔符) WITHIN GROUP( ORDER BY 分组维度)
2、解析
with temp as( select '中国' country ,'北京' city from dual union all select '中国' country ,'深圳' city from dual union all select '中国' country ,'上海' city from dual ) select country,listagg(city,',') within GROUP (order by country) as brands from temp group by country
标签:多行,city,listagg,country,拼接,dual,oracle,select From: https://www.cnblogs.com/lgx5/p/17728853.html