oracle语句,我想查询A表中的a字段下的值不等于B表中b的值的数据,

如题所述

这个的话,需要用到not in来实现。
select * from A where a not in ( select b from B);
备注:以上语句就是从B表中先读取出来所有的b的值,之后通过not in函数进行判断,不符合条件的输出结果。
温馨提示:内容为网友见解,仅供参考
第1个回答  2013-01-31
select A.*
from A,B
WHERE A.ID= B.ID
AND A.a<>B.b;
第2个回答  2013-02-01
①select * from A where a not in (
select b from B)
② select a from A
minus
select b from B
第3个回答  2013-01-31
select * from A where a not in (
select b from B)本回答被提问者采纳
相似回答