Tuesday, February 16, 2010

not in & NOT EXISTS... SUGAR and SUGAR CANE

NOT EXISTS can yield different results from NOT IN.
---------------------------------------------------------------
NOT IN implies that data exists in the column. A predicate testing a
column containing a NULL value will not satisfy the NOT IN condition.
(verified on UDB LUW 8.1)

A null value in a code will satisfy the NOT EXISTS clause in your second
example. This is true even if t2 has a row containing a null value in eid!

No comments:

Post a Comment