pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Richard Huxton <dev@archonet.com>
To: yon@dugem.com, Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-sql@postgresql.org
Subject: Re: SELECT ... WHERE ... NOT IN (SELECT ...);
Date: Fri, 23 Aug 2002 10:24:28 +0100
Message-ID: <200208231024.28241.dev@archonet.com> (raw)
In-Reply-To: <20020823082835.959193953@sitemail.everyone.net>
References: <20020823082835.959193953@sitemail.everyone.net>

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



view thread (9+ messages)  latest in thread

Message-ID: <200208231024.28241.dev@archonet.com>
Permalink:  ../200208231024.28241.dev@archonet.com/
Also on:    postgresql.org/message-id/200208231024.28241.dev@archonet.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: dev@archonet.com, tgl@sss.pgh.pa.us
  Subject: Re: SELECT ... WHERE ... NOT IN (SELECT ...);
  In-Reply-To: <200208231024.28241.dev@archonet.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox