EXPLAIN EXTENDED

How to create fast database queries

Archive for May 2nd, 2009

GROUP_CONCAT in PostgreSQL without aggregate functions

with one comment

In one of the previous articles:

Aggregate concatenation

, I described an aggregate function to concatenate strings in PostgreSQL, similar to GROUP_CONCAT in MySQL.

It's very useful if you have a complex GROUP BY query with multiple conditions.

But for some simple queries it's possible to emulate GROUP_CONCAT with pure SQL, avoiding custom functions at all.

Let's create a table to demonstrate our task:
Read the rest of this entry »

Written by Quassnoi

May 2nd, 2009 at 11:00 pm

Posted in PostgreSQL