oracle的listagg函数
今天需要将 BDST_ID相同的PROJECT_ID用逗号分隔拼成一个字符串,于是想到了oracle的listagg函数
表名为PM_BDST_PROJECT
select
tt.BDST_ID,
listagg (tt.PROJECT_ID, ',') WITHIN GROUP (ORDER BY tt.PROJECT_ID) PROJECT_IDS
FROM PM_BDST_PROJECT tt
GROUP BY tt.BDST_ID
这样就大功告成了......