USE tpch1; select 'q1', sub1.* from sub1 where c1 not in (select c1 from sub2 where sub1.c3 = sub2.c3) order by 1, 2, 3; q1 c1 c2 c3 s1 s2 s3 q1 2 2 2 2 2 2 q1 3 3 3 3 3 3 q1 4 1 1 1 1 1 q1 5 99 99 99 99 99 q1 6 NULL NULL NULL NULL NULL select 'q2', c1,c3,c2 from sub1 where (c1,c3) not in (select c1,c3 from sub2 where sub1.c2 = sub2.c2) order by 1, 2, 3; q2 c1 c3 c2 q2 2 2 2 q2 3 3 3 q2 4 1 1 q2 5 99 99 q2 6 NULL NULL select 'q4', c1 from sub1 where c1 not in (select c2 from sub2) order by 1, 2; q4 c1