select a.* from T1 a,T2 b where a.x<>b.x

解决方案 »

  1.   

    select a.* from T1 a
    inner join T2 b 
    on a.x<>b.x
      

  2.   

    select * from a,b where a.x<>b.x
      

  3.   

    c1-c2:select * from t1 where not exists(select 1 from t2 where t1.c1=t2.c1 and t1.c2=t2.c2)c2-c1:select * from t2 where not exists(select 1 from t1 where t1.c1=t2.c1 and t1.c2=t2.c2)
    你要哪个?,还是:select * from t1 where not exists(select 1 from t2 where t1.c1=t2.c1 and t1.c2=t2.c2)
    union all
    select * from t2 where not exists(select 1 from t1 where t1.c1=t2.c1 and t1.c2=t2.c2)
      

  4.   

    select * from t1 where X not in (select X from t2 )
    union all
    select * from t2 where X not in (select X from t1)