Aggregate function in MySQL – list (like LISTAGG in Oracle)

You’re looking for GROUP_CONCAT()

Try this:

select group_concat(MyString separator ', ') as myList from table
where id < 4

Of course, you can group by the results.

Leave a Comment