Archives of the TeradataForum
Message Posted: Thu, 17 Feb 2005 @ 07:56:31 GMT
Glenn McCall wrote:
Of course you're right, that's why i sent a second mail correcting that error...
No matter, if you use "(a,b) in (a,b)" or "(b,a) in (b,a)", the result always *must* be the same.
It's like "t1 join t2 on t1.a = t2.a and t1.b = t2.b"
select * from test1 where (a,b) not in (select b,a from test2); *** Query completed. No rows found. *** Total elapsed time was 1 second.
select * from test1 where (b,a) not in (select b,a from test2);
I was surprised, too ;-)
I especially like that nice explanation:
"if a null is in a field other than the first field of expression_list_2 then some rows may be returned"
(SQL Ref. Functions and Operators, Chapter 10: Logical Predicates, IN/NOT IN, Behavior of Nulls for NOT IN)
|Copyright 2016 - All Rights Reserved|
|Last Modified: 28 Jun 2020|