1. 程式人生 > >Oracle聚合函式學習

Oracle聚合函式學習

參考地址:https://blog.csdn.net/kancy110/article/details/74616909

https://blog.csdn.net/sinat_35626559/article/details/72621695

SELECT
            t.QUESTIONNAIRE_ID , listagg(GROUP_NAME,',') within group(order by t.QUESTIONNAIRE_ID)
        FROM
            T_QMR_QUESTIONNAIRE_GROUP T
        JOIN T_NTM_RECEIVER_GROUP G ON G . ID = T .RECEIVER_GROUP_ID
        WHERE
            T .DELETE_FLAG = 1
        AND G .DELETE_FLAG = 1
       
        GROUP BY t.QUESTIONNAIRE_ID