首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > oracle >

怎么判断A表的值在不在B表里面

2013-12-05 
如何判断A表的值在不在B表里面 sql 语句查询出来的值 在a表里面不错在。select *from b where b.code not i

如何判断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)

热点排行