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

From Tom Lane
Subject Re: SELECT ... WHERE ... NOT IN (SELECT ...);
Date
Msg-id 17318.1030080523@sss.pgh.pa.us
Whole thread Raw
In response to SELECT ... WHERE ... NOT IN (SELECT ...);  (Yon Den Baguse Ngarso <yon@dugem.com>)
List pgsql-sql
Yon Den Baguse Ngarso <yon@dugem.com> writes:
> I'm confused, the result should not 0 rows, right?

Not what I get:

regression=# create table tbl1(eventid int);
CREATE TABLE
-- load data
regression=# SELECT eventid FROM tbl1;eventid
--------- 119064 119064  60116  16082  16082  16303  16082  92628  92628  60083
(10 rows)

regression=# create table tbl2(eventid int);
CREATE TABLE
-- load data
regression=# SELECT eventid FROM tbl2;eventid
--------- 123989 123989 123989  16134  16134  16368  16134  92685  92685  60115
(10 rows)

regression=# SELECT eventid FROM tbl1 WHERE eventid NOT IN (SELECT eventid FROM tbl2);eventid
--------- 119064 119064  60116  16082  16082  16303  16082  92628  92628  60083
(10 rows)


I think there must be something you didn't tell us...
        regards, tom lane


pgsql-sql by date:

Previous
From: "Rajesh Kumar Mallah."
Date:
Subject: speeding up \d commands.
Next
From: Björn Lundin
Date:
Subject: Re: speeding up \d commands.