MySQL group_concat, 오라클에서는?

11g

SELECT 
RTRIM(LISTAGG(COLUMN_NAME || ‘, ‘) WITHIN GROUP(ORDER BY 1),’, ‘) COLUMN_NAME
FROM all_tab_cols
WHERE owner=’TEST’ AND table_name =’TB_COM0300';

10g

SELECT 
RTRIM(XMLAGG(XMLELEMENT(R,COLUMN_NAME,’, ‘).EXTRACT(‘//text()’)),’, ‘) COLUMN_NAME
FROM all_tab_cols
WHERE owner=’TEST’ AND table_name =’TB_COM0300';
Like what you read? Give 곤피밍플 a round of applause.

From a quick cheer to a standing ovation, clap to show how much you enjoyed this story.