Re: [HACKERS] Subselects and NOTs

From: "Vadim B(dot) Mikheev" <vadim(at)sable(dot)krasnoyarsk(dot)su>
To: Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>
Cc: hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] Subselects and NOTs
Date: 1998-02-18 13:38:55
Message-ID: 34EAE46F.281C6CA7@sable.krasnoyarsk.su
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Martin 1998-02-18 14:51:35 Re: [HACKERS] Valid ports for v6.3
Previous Message Vadim B. Mikheev 1998-02-18 13:22:14 Re: [HACKERS] results of regression tests: NetBSD/i386 v1.3