[SQL] Concatenate results of a single column query

2004-04-18 Thread Marco Lazzeri
Hi All, I would like to concatenate results of a single column query using PostgreSQL 7.3. Something like the coming feature SELECT p.name, ARRAY(SELECT nicknames FROM people WHERE people.id = p.id) FROM people AS p (devel docs for 7.5: http://developer.postgresql.org/docs/postgres/sql-express

Re: [SQL] Concatenate results of a single column query

2004-04-18 Thread Greg Stark
Marco Lazzeri <[EMAIL PROTECTED]> writes: > SELECT > p.name, ARRAY(SELECT nicknames FROM people WHERE people.id = p.id) > FROM people AS p > Any suggestions? Something like: db=> create aggregate array_aggregate (basetype = integer, sfunc = array_append, stype = integer[], initcond = '{}');

Re: [SQL] problem porting MySQL SQL to Postgres

2004-04-18 Thread Markus Bertheau
Ð ÐÑÐ, 15.04.2004, Ð 13:15, Paul Thomas ÐÐÑÐÑ: > On 15/04/2004 11:25 Dan Field wrote: > Your "= NULL" tests are also not valid SQL (should be IS NULL). I think = NULL _is_ valid SQL, it just doesn't do what you think. -- Markus Bertheau <[EMAIL PROTECTED]> ---(end of b

Re: [SQL] problem porting MySQL SQL to Postgres

2004-04-18 Thread Paul Thomas
On 18/04/2004 19:37 Markus Bertheau wrote: В Чтв, 15.04.2004, в 13:15, Paul Thomas пишет: > On 15/04/2004 11:25 Dan Field wrote: > Your "= NULL" tests are also not valid SQL (should be IS NULL). I think = NULL _is_ valid SQL, it just doesn't do what you think. It's valid in an assignment update

Re: [SQL] problem porting MySQL SQL to Postgres

2004-04-18 Thread Bruno Wolff III
On Sun, Apr 18, 2004 at 20:24:47 +0100, Paul Thomas <[EMAIL PROTECTED]> wrote: > > PostgreSQL can be coerced into accepting where foo = null with the > transform_null_equals run-time option but that doesn't make it legal SQL > IFAIK. foo = NULL is a valid SQL expression that always returns NU