This question is an exact duplicate of:
- Not able to use LISTAGG 1 answer
SELECT deptno,
LISTAGG(ename, ',') WITHIN GROUP (ORDER BY ename) AS employees
FROM emp
GROUP BY deptno;
Error:- ORA-00923: FROM keyword not found where expected 00923. 00000 - "FROM keyword not found where expected" *Cause:
*Action: Error at Line: 1 Column: 42
Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production
For the
10gR2
or11gR1
versions of Oracle , you can use hierarchical queries with the contribution ofsys_connect_by_path
: