oracle將多行字段拼接成一個列 (listagg函數)
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

不管在什么地方上班,請記?。? 工作不養閑人,團隊不養懶人。入一行先別惦記著賺錢,先學著讓自己值錢。賺不到錢賺知識;賺不到知識賺經歷;賺不到經歷賺閱歷;以上都賺到了就不可能賺不到錢。只有先改變自己的態度,才能改變人生的高度。
讓一個人迷茫的原因只有一個,那就是本該拼搏的年紀,卻想的太多,做的太少。

浙公網安備 33010602011771號