=?iso-8859-1?Q?SZUCS_G=E1bor?= <[EMAIL PROTECTED]> writes:
>> It's NULLs inside the subselect that are the issue.
> 
> select 1 in (select a from foo)
> select exists ( select 1 from foo where a=1)

> Just a dumb try :)

>   SELECT (exists(select 1 from foo where a isnull) AND NULL)
>        OR exists(select 1 from foo where a=1)

The more general case is where you have a variable (or expression)
on the left of IN.  That could be NULL too, and this still doesn't
give the right result in that case :-(.  With NULL on the left the
correct answer would be FALSE if the subselect has zero rows,
NULL otherwise.

                        regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

               http://www.postgresql.org/docs/faqs/FAQ.html

Reply via email to