[SQL] ordered by join? ranked aggregate? how to?

2009-09-14 Thread wstrzalka
What I need is to join 2 tables CREATE TABLE master( id INT4 ); CREATE TABLE slave ( master_id INT4, rank INT4, value TEXT); What I need is to make the query: SELECT m.id, array_agg(s.value) AS my_problematic_array FROM master AS m LEFT JOIN slave AS s ON (m.id = s.master_id)

Re: [SQL] ordered by join? ranked aggregate? how to?

2009-09-16 Thread wstrzalka
On 15 Wrz, 09:56, andreas.kretsch...@schollglas.com ("A. Kretschmer") wrote: > In response to wstrzalka : > > > > > What I need is to join 2 tables > > > CREATE TABLE master( > >     id INT4 > > ); > > > CREATE TABLE slave ( >

Re: [SQL] ordered by join? ranked aggregate? how to?

2009-09-16 Thread wstrzalka
On 15 Wrz, 10:10, wstrzalka wrote: > On 15 Wrz, 09:56, andreas.kretsch...@schollglas.com ("A. Kretschmer") > wrote: > > > > > In response to wstrzalka : > > > > What I need is to join 2 tables > > > > CREATE TABLE master( > > >     i