Re: [HACKERS] Subselects and NOTs
Vadim Mikheev <vadim@sable.krasnoyarsk.su>
From: "Vadim B. Mikheev" <vadim@sable.krasnoyarsk.su>
To: Bruce Momjian <maillist@candle.pha.pa.us>
Cc: hackers@postgreSQL.org
Date: 1998-02-18T13:38:55Z
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