Are SQL tuples, when used as predicates, just a syntactic sugar for expanded logical AND's or there is more to it?
eg.
with tmp1(c1,c2,c3) as (
select * from (
values(1,'a','apple')
,(2,'b','ball')
,(3,'c','cat')
,(4,'d','dog')
,(5,'e',null)
)
)
select * from tmp1 where (c1,c2,c3) = (1,'a','apple');
is equivalent to
select * from tmp1 where c1 = 1 and c2 = 'a' and c3 = 'apple';
and similarly for IN clause or JOIN's
I did check for NULL awareness(if it would get translated to the form x IS NOT DISTINCT FROM y) but atleast DB2 isn't
select * from tmp1 where (c1,c2,c3) = (5,'e',null); -- Empty resultset