[SQL] Multiple outer join on same table

2004-05-13 Thread Marco Lazzeri
Hi! I'm searching a better (quicker) way to retrieve data as I used to do using the following query... == SELECT main.codice, other.value AS value_one, other.value AS value_two FROM main LEFT OUTER JOIN otherON main.id = other.id_main LEFT

Re: [SQL] Check a value in array

2004-04-30 Thread Marco Lazzeri
Il gio, 2004-04-29 alle 19:56, Rod Taylor ha scritto: On Thu, 2004-04-29 at 13:37, Marco Lazzeri wrote: Hi all. I have to check if a value is in an array. I've got a date array in a table and I would like to perform queries like: SELECT * FROM table WHERE date IN dates_array

[SQL] Check a value in array

2004-04-29 Thread Marco Lazzeri
Hi all. I have to check if a value is in an array. I've got a date array in a table and I would like to perform queries like: SELECT * FROM table WHERE date IN dates_array; I've tried using array_contains_date (contrib/array_iterator.sql) function unsuccessfully: SELECT

[SQL] Concatenate results of a single column query

2004-04-19 Thread Marco Lazzeri
Hi All, I would like to concatenate results of a single column query, something like the futurable (dev docs for 7.5) SELECT p.name, ARRAY(SELECT nicknames FROM people WHERE people.id = p.id) FROM people AS p Any suggestions? Thanks Marco ---(end of

[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: