oracle function of listagg

Today will need the same BDST_ID PROJECT_ID makes up a string of comma-separated, so the thought of listagg function of oracle

Table called 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

This is done......

 

Guess you like

Origin www.cnblogs.com/houchen/p/11414866.html