竖变横 oracle group by 方式

前端之家收集整理的这篇文章主要介绍了竖变横 oracle group by 方式前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
SELECT DCC.CONSTRAINT_NAME,(LISTAGG(DCC.COLUMN_NAME,',') WITHIN GROUP (ORDER BY DCC.POSITION)) COLUMN_NAME_LIST FROM DBA_CONS_COLUMNS DCC JOIN DBA_CONSTRAINTS DC ON DCC.CONSTRAINT_NAME=DC.CONSTRAINT_NAME WHERE DCC.OWNER = 'GCE_Meta' AND DCC.TABLE_NAME = 'CP_PROCESS_CUSIP_MAP' AND DC.CONSTRAINT_TYPE = UPPER('P') GROUP BY DCC.CONSTRAINT_NAME SELECT DCC.CONSTRAINT_NAME,DCC.COLUMN_NAME FROM DBA_CONS_COLUMNS DCC JOIN DBA_CONSTRAINTS DC ON DCC.CONSTRAINT_NAME=DC.CONSTRAINT_NAME WHERE DCC.OWNER = 'GCE_Meta' AND DCC.TABLE_NAME = 'CP_PROCESS_CUSIP_MAP' AND DC.CONSTRAINT_TYPE = UPPER('P') 原文链接:https://www.f2er.com/oracle/210910.html

猜你在找的Oracle相关文章