From: pgsql-general-owner@xxxxxxxxxxxxxx [mailto:pgsql-general-owner@xxxxxxxxxxxxxx] On Behalf Of Richard Broersma On Tue, Oct 23, 2012 at 12:21 PM, Richard Broersma <richard.broersma@xxxxxxxxx> wrote: On Tue, Oct 23, 2012 at 12:06 PM, Chris Curvey <chris@xxxxxxxxxxxxxxx> wrote: select my_ids.id
oops - I had some malformed air code
GROUP BY id
The main problem with this code is that the length of the array varies between rows depending on which attributes are missing entries. You would want to generate dummy records for any missing attributes and then apply the ARRAY_AGG. David J. |