Re: [HACKERS] Subselects and NOTs - Mailing list pgsql-hackers

From Vadim B. Mikheev
Subject Re: [HACKERS] Subselects and NOTs
Date
Msg-id 34EAE46F.281C6CA7@sable.krasnoyarsk.su
Whole thread Raw
In response to Re: [HACKERS] Subselects and NOTs  (Bruce Momjian <maillist@candle.pha.pa.us>)
List pgsql-hackers
Bruce Momjian wrote:
>
> >
> > Is 'not X in' the same as 'X not in' ? Currently we have:
>
> I am not sure about this, but I believe 'not X in subselect' is
> evaluated as 'not (x in subselect)' and not as 'X not in subselect'.  Am
> I missing something?

Even 'not (x in subselect)' doesn't help in Oracle! This works just
as 'x not in subselect'.

Ok, if we don't know what standard say then could you test this
in Informix, etc. Don't forget put NULL into table in subselect
to get 'no rows selected' for 'x not in subselect'...

>
> Also they show:
>
> select *
> from test
> where x <> (select y
>             from test2)
>
> When test2 returns no rows, the query returns no rows because the
> subquery returns a single row of NULL values.

This is exactly how it works in postgres and Oracle.

Vadim

pgsql-hackers by date:

Previous
From: "Vadim B. Mikheev"
Date:
Subject: Re: [HACKERS] results of regression tests: NetBSD/i386 v1.3
Next
From: "Thomas G. Lockhart"
Date:
Subject: Lost a function overloading capability?