A表中有food列
B表中也有food列
要求 查询A表中在B表中food没关联的数据
例如 A 南瓜 冬瓜 西葫芦
B 南瓜 冬瓜 卷心菜
结果要把西葫芦查出来 因为西葫芦在B表中没有关联数据
select * from A as o where o.food not in (select distinct(a.food) from b as a)
要是查询有数据的就是in
A表中有food列
B表中也有food列
要求 查询A表中在B表中food没关联的数据
例如 A 南瓜 冬瓜 西葫芦
B 南瓜 冬瓜 卷心菜
结果要把西葫芦查出来 因为西葫芦在B表中没有关联数据
select * from A as o where o.food not in (select distinct(a.food) from b as a)
要是查询有数据的就是in