Re: NULLs: theoretical problems?
Date: Fri, 24 Aug 2007 14:42:45 +0200
Message-ID: <famjo6$i68$1_at_orkan.itea.ntnu.no>
Quoth V.J. Kumar:
> I do not understand why they are not equivalent.
>
> The first SQL predicate, according to your rules, evaluates to 'true':
> 'DEF t.a : (t.a = 5 OR TRUE)' -> 'FALSE OR TRUE' -> 'TRUE'
>
> The second SQL predicate also evaluates to 'true':
> 't.a = 5 OR TRUE' -> 'UNKNOWN OR TRUE' -> 'TRUE'
>
> What is the difference ?
If I understand it correctly, the first evaluates to TRUE for rows where
t.a is defined, and FALSE for rows where t.a is not; whereas the second
evaluates to TRUE regardless.
or, if we simplify, it's the difference between
SELECT * FROM t WHERE t.a IS NOT NULL -- the DEF query
and
But I believe these queries are equivalent:
SELECT * FROM t WHERE DEF t.a : t.a = 5
SELECT * FROM t -- The other one
-- JonReceived on Fri Aug 24 2007 - 14:42:45 CEST