ORACLE SQL listagg function

I'm not sure what is going on here, mainly because I never used this function, but when I use the listagg function in our Oracle 11g database, it gives me ORA-00923 FROM keyword not found where expected.

Here is my sql

SELECT cdm.courses_id,cde.additional_resources, listagg (dm.delivery_method_desc, ',') WITHIN GROUP (ORDER BY dm.delivery_method_desc) delivery_methods FROM tablespace.course_de_delivery_methods cdm, tablespace.course_distance_ed cde, tablespace.delivery_methods dm WHERE cdm.courses_id = cde.courses_id AND cdm.delivery_methods_id = dm.delivery_methods_id GROUP BY cdm.courses_id 

I don’t know why it breaks. I followed suit here.

+8
sql oracle ora-00923
source share
1 answer

Are you using 11.1 or 11.2? LISTAGG was introduced in 11.2, it was not available in 11.1.

Your SQL statement looks valid for me in 11.2. But you will get the error in 11.1, and ORA-00923 will seem like a reasonable error in 11.1.

+17
source share

All Articles