如何判断A表的值在不在B表里面
sql 语句查询出来的值 在a表里面不错在。
select * from b where b.code not in (select code from a)
问题: 如果3个字段(code,linecode,name)才能判断在a 表里面不存在该怎么写???
select * from b where (select code,linecode,name NOT IN (SELECT code,linecode,name FROM b))
------解决方案--------------------b=a(+) 选择a表都为空的项,或者慢慢and ** not in (selectment)and ** not in (selectment)
------解决方案--------------------select * from b where exits(select 1 from a where a.code= b.code and a.linecode = b.linecode and a.name= b.name)