Question
Philips
NL
Last activity: 23 Aug 2016 4:52 EDT
How to use LISTAGG function in Report Definition?
Hi all,
I've worte following user function:
Add it to my Report Definition:
Now that RD generate following SQL code:
SELECT LISTAGG("PC0".TEAMMEMBERNAME, ',') WITHIN GROUP (ORDER BY "PC0".TEAMMEMBERNAME) AS "pyTextValue(1)", "PC0".CASEID FROM PRPC.MYORDERS_TEAMMEMBERS "PC0";
And it executes with error:
ORA-00937: not a single-group group function
Yes, this right, this function will not work without group by statement at the end of sql query:
SELECT LISTAGG("PC0".TEAMMEMBERNAME, ',') WITHIN GROUP (ORDER BY "PC0".TEAMMEMBERNAME) AS "pyTextValue(1)", "PC0".CASEID FROM PRPC.MYORDERS_TEAMMEMBERS "PC0" GROUP BY CASEID;
Question: how to add this "GROUP BY CASEID" in Report Defenition?