string_agg No function matches the given name

Try this:

select product_id , string_agg(quiz_id::character varying, ',' order by lastmodified) 
from quiz group by product_id;

String_agg function works with String values only ,You are getting the error because quiz_id is integer.

I have converted it to character varying and added group by for grouping the data product ID wise.

SQL Fiddle Example:http://sqlfiddle.com/#!15/9dafe/1

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)