有如下数据:
使用listagg函数转化后结果:
sql:
SELECT TPID_ID, listagg ( PART_CODE, ',' ) WITHIN GROUP ( ORDER BY PART_CODE ) AS PART_CODE FROM TT_PPAP_INIT_DTL_EXT WHERE TPID_ID = 1663 GROUP BY TPID_ID;
有如下数据:
使用listagg函数转化后结果:
sql:
SELECT TPID_ID, listagg ( PART_CODE, ',' ) WITHIN GROUP ( ORDER BY PART_CODE ) AS PART_CODE FROM TT_PPAP_INIT_DTL_EXT WHERE TPID_ID = 1663 GROUP BY TPID_ID;