Re: [GENERAL] PostgreSQL group sort

2011-02-24 Thread Vibhor Kumar
On Feb 25, 2011, at 11:45 AM, zab08 wrote: > run : > SELECT b.id, array_accum(s.id), array_accum(s.name)from big b, sm s where > b.id = s.big_id group by b.id; > (ps: array_accum is aggregate in > http://www.postgresql.org/docs/9.0/static/xaggr.html) > > id | array_accum | array_accum > --

[GENERAL] PostgresQL group sort

2011-02-24 Thread zab08

[GENERAL] PostgreSQL group sort

2011-02-24 Thread zab08
use these sqls: CREATE TABLE big(id serial, name text); CREATE TABLE sm(id serial, big_id integer, name text); INSERT into big (id, name) VALUES (1, 'big1'); INSERT into big (id, name) VALUES (2, 'big2'); INSERT into sm(id, big_id, name)VALUES (2, 1, 'sm1'); INSERT into sm(id, big_id, name)VALU