select * from tabl
where checksum(a,b,c) in(select checksum(a,b,c) from tab2)

解决方案 »

  1.   

    --相同的:
    select a,b,c,d from tab1 where exists(select * from tab2 where tab1.a=tab2.a and tab1.b=tab2.b and tab1.c=tab2.c and tab1.d=tab2.d)--不同的:
    select a,b,c,d from tab1 where not exists(select * from tab2 where tab1.a=tab2.a and tab1.b=tab2.b and tab1.c=tab2.c and tab1.d=tab2.d)
    union all
    select a,b,c,d from tab2 where not exists(select * from tab2 where tab1.a=tab2.a and tab1.b=tab2.b and tab1.c=tab2.c and tab1.d=tab2.d)
      

  2.   

    --不同的:
    select a,b,c,d from tab1 where not exists(select * from tab2 where tab1.a=tab2.a and tab1.b=tab2.b and tab1.c=tab2.c and tab1.d=tab2.d)
    union all
    select a,b,c,d from tab2 where not exists(select * from tab1 where tab1.a=tab2.a and tab1.b=tab2.b and tab1.c=tab2.c and tab1.d=tab2.d)