Re: [SQL] CHECK constraint on multiple tables

2009-09-15 Thread Rob Sargent
Mario Splivalo wrote: Tom Lane wrote: Mario Splivalo writes: I have two tables, tableA and tableB: CREATE TABLE tableA (idA integer primary key, email character varying unique); CREATE TABLE tableB (idB integer primary key, email character varying unique); Now, I want to create

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

2009-09-15 Thread A. Kretschmer
In response to 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 > F

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

2009-09-15 Thread A. Kretschmer
In response to 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 > F