Re: [SQL] Problem with NOT IN portion of query.

2004-01-11 Thread Tomasz Myrta
Dnia 2004-01-12 05:04, Użytkownik Robert Creager napisał: Hey All, Probably doing something stupid, and I'm too tired to see what. The query I'm trying to execute is: SELECT date_trunc( 'hour', "when" )::timestamp AS period FROM readings WHERE period NOT IN (SELECT "time" FROM hour.summary_period

[SQL] Unique key field or serverl fks ?

2004-01-11 Thread katarn
Hi, I would like to know opinions about which approach is better: Having a table with a field that works as a unique key, or having several fks that work as a combined key ( all the fks fields )? Thanks in advance, K. ---(end of broadcast)--- TI

[SQL] Problem with NOT IN portion of query.

2004-01-11 Thread Robert Creager
Hey All, Probably doing something stupid, and I'm too tired to see what. The query I'm trying to execute is: SELECT date_trunc( 'hour', "when" )::timestamp AS period FROM readings WHERE period NOT IN (SELECT "time" FROM hour.summary_period) GROUP BY period ORDER BY period; Where the table defi

Re: [SQL] Missing data for column

2004-01-11 Thread azwa
Hi,  Sorry for the late respond. i've solved my problem. the error comes out when the data has subsidiary column but there is no subsidiary column in table. tq Michael Glaesemann <[EMAIL PROTECTED]> 01/09/2004 06:54 PM ZE9         To:        [EMAIL PROTECTED]         cc:        [EM

[SQL] Select into

2004-01-11 Thread beyaRecords - The home Urban music
Hi, I want to copy a sequence of rows from one table into another table. I have tried select into but this will only work if the table you are copying to does not already exist. How do I copy to a table that does already exist? regards Uzo ---(end of broadcast)

Re: [SQL] Left outer join on multiple tables

2004-01-11 Thread Peter Eisentraut
David Witham wrote: > Is there a way to do left outer joins on more than 2 tables at once > (3 in my case)? Or do I have to do the first join into a temp table > and then another join from the temp table to the third table? I can't > seem to work out the syntax from the User Guide. SELECT * FROM a

[SQL] Left outer join on multiple tables

2004-01-11 Thread David Witham
Hi all, Is there a way to do left outer joins on more than 2 tables at once (3 in my case)? Or do I have to do the first join into a temp table and then another join from the temp table to the third table? I can't seem to work out the syntax from the User Guide. Thanks, David Witham Telephony

Re: [SQL] Different query results in psql and Perl DBI with Postgres 7.2.1

2004-01-11 Thread Greg Sabino Mullane
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Brendan LeFebvre writes: > Even more perplexing: the "0E0" occurs ONLY when setting status to > 'STORE', and not 100% of the time. (though it happens far more often > than not.) It seems to operate in stretches, too: when I am getting > 1-row upd