LISTAGG(列名,<分隔符>) WITHIN GROUP(ORDER BY 列名)函数
SELECT D.id,LISTAGG(E.keyword,',') WITHIN GROUP(ORDER BY E.keyword) AS keyword
FROM STOCK_LIVE D
LEFT JOIN STOCK_KEYWORD E ON D.id = E.SPECIAL_ID where d.id=141211111
GROUP BY D.id
WM_CONCAT(列名)函数(速度慢)
SELECT D.id,WM_CONCAT(E.keyword) AS keyword
FROM STOCK_LIVE D
LEFT JOIN STOCK_KEYWORD E ON D.id = E.SPECIAL_ID where d.id=141211111
GROUP BY D.id
二者效果一样,但是wm_concat我测试得时候速度特别慢