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

From: "OU" <moebius444(at)hotmail(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: SELECT ... WHERE ... NOT IN (SELECT ...);
Date: 2002-08-24 19:23:46
Message-ID: ak8k3g$uvp$1@news.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql


I use a 7.3devel recently build (on a FreeBSD 4.3 box) from CVS sources.
I follow all your steps, and psql results :

test_db=> \! cat problem.sql
--create new temp tbl1
SELECT losteventid AS eventid INTO tbl1 FROM outages;
--create new temp tbl2
SELECT regainedeventid AS eventid INTO tbl2 FROM outages;

SELECT eventid FROM tbl1 WHERE eventid NOT IN (SELECT eventid FROM tbl2);

test_db=> \i problem.sql
SELECT
SELECT
eventid
---------
119064
119064
60116
16082
16082
16303
16082
92628
92628
60083
(10 rows)

"Yon Den Baguse Ngarso" <yon(at)dugem(dot)com> a crit dans le message de news:
20020823082835(dot)959193953(at)sitemail(dot)everyone(dot)net(dot)(dot)(dot)
> Oops correction.
>
... cut
>
> myhost=# SELECT eventid FROM tbl1 WHERE eventid NOT IN (SELECT eventid
FROM tbl2);
> eventid
> ---------
> (0 rows)
>
> TIA,
> Yon
>

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message OU 2002-08-24 21:52:23 Re: Separating data sets in a table
Previous Message Greg Patnude 2002-08-24 01:15:28 Retrieving the new "nextval" for primary keys....