Re: SELECT ... WHERE ... NOT IN (SELECT ...);

From: Richard Huxton <dev(at)archonet(dot)com>
To: yon(at)dugem(dot)com, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: SELECT ... WHERE ... NOT IN (SELECT ...);
Date: 2002-08-23 09:24:28
Message-ID: 200208231024.28241.dev@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Andreas Tille 2002-08-23 10:00:12 Updatable View (Was: Separating data sets in a table)
Previous Message Roger Mathis 2002-08-23 09:11:51 signed/unsigned integers