Re: SELECT ... WHERE ... NOT IN (SELECT ...); - Mailing list pgsql-sql

From Richard Huxton
Subject Re: SELECT ... WHERE ... NOT IN (SELECT ...);
Date
Msg-id 200208231024.28241.dev@archonet.com
Whole thread Raw
In response to Re: SELECT ... WHERE ... NOT IN (SELECT ...);  (Yon Den Baguse Ngarso <yon@dugem.com>)
List pgsql-sql
On Friday 23 Aug 2002 9:28 am, Yon Den Baguse Ngarso wrote:
> Oops correction.
>
> If i create tbl1 & tbl2, and then load it with the data.
> The result is CORRECT. Like yours.
>
> But, if the data loaded from another table, the result become WRONG/ null
> record.
>
> Here is my detail step. Please Help.

> myhost=# --create new temp tbl1
> myhost=# SELECT losteventid AS eventid INTO tbl1 FROM outages;
> myhost=# --create new temp tbl2
> myhost=# SELECT regainedeventid AS eventid INTO tbl2 FROM outages;

These aren't creating temporary tables, they are creating permanent tables. Do
you have data from previous runs in there?

Try SELECT ... INTO TEMPORARY tbl1 ...

- Richard Huxton


pgsql-sql by date:

Previous
From: Yon Den Baguse Ngarso
Date:
Subject: Re: SELECT ... WHERE ... NOT IN (SELECT ...);
Next
From: Andreas Tille
Date:
Subject: Updatable View (Was: Separating data sets in a table)