日期:2014-05-16  浏览次数:20440 次

两个表相同,查询问题
table A  table B
table A
djbh,   shl,   je,   name,    he
123       1      2        test       1
124       2      3         test1    1
 table b
xgdjbh ,djbh,      shl,  je,    name   he
q123     123         1     2         test      1


如何查询量表不相同的结果
djbh      shl      je     name      he
1234     2        3          test1    1
------解决方案--------------------

  
select * from tableA a where not exists(
select * from tableB where a.djbh=b.djbh and a.shi=b.shi
and a.je=b.je and a.name=b.name and a.he=b.he  
)