i have a table name table1 with composite pks on (A,B,C) And non keyfields (D,E,F)
on table 2 I have also composite pks on (A,B,C)
is it possible to have
select * from table 1 except select a,b,c from table2
i want to compare on pks only
or do i need to
select a, b,c , d,e,f from table1 except select a,b,c from table 2
join
select * from table1 as table3 on
table1.a=table3.a and
table1.b=table3.b and
table1.c=table3.c
thanks
If you want to get the non-key columns also then you can just use NOT EXISTS like:
select a, b, c, d, e, f
from table1 as t1
where not exists(select * from table2 as t2 where t2.a = t1.a and t2.b = t1.b and t2.c = t1.c)
|||thanks
No comments:
Post a Comment