Subject | Re: [firebird-support] Unexpected behavior in subquery |
---|---|
Author | Dmitry Yemanov |
Post date | 2008-07-10T17:43:24Z |
Alex Castillo wrote:
within, then the result of the NOT IN predicate is false. If you don't
need this behaviour, use NOT EXISTS instead.
Dmitry
>Please read the SQL standard. If subquery contains any NULL value
> I've been using Fb 2.0.1 and now 2.1 and I got an unexpected behavior in the
> next queries:
>
> 1.-
> SELECT FOLIOVENTA FROM VENTAMOSTRADOR
> RESULT 822 ROWS (CORRECT)
>
> 2.-
> SELECT FOLIOVENTA FROM CONTRATOTARIFARIO WHERE FOLIOVENTA IS NOT NULL
> RESULT 107 ROWS (CORRECT)
>
> 3.- *********** unexpected ***************
> SELECT folioventa from VENTAMOSTRADOR WHERE
> folioventa not in (SELECT folioventa from CONTRATOTARIFARIO)
> 0 ROWS (WRONG !!!!!!!!!! )
within, then the result of the NOT IN predicate is false. If you don't
need this behaviour, use NOT EXISTS instead.
Dmitry