这个的话,需要用到not in来实现。
select * from A where a not in ( select b from B);
备注:以上语句就是从B表中先读取出来所有的b的值,之后通过not in函数进行判断,不符合条件的输出结果。
select A.*
from A,B
WHERE A.ID= B.ID
AND A.a<>B.b;
①select * from A where a not in (
select b from B)
② select a from A
minus
select b from B
select * from A where a not in (
select b from B)