遇到个查询难题。
a 表 b 表 c表
a 里面包括b和c表里面的一些数据,我要筛选出a表中不包含b和c表中的数据。
select * from a where email not in (select email from b)
目前只实现了去除包含b表里面的数据,我想同时去除b和c表里面的数据,该如何写?请教各位大侠了。
[解决办法]
select * from a where not exists(select 1 from b where email=a. email) and not exists(select 1 from c where email=a. email)
[解决办法]
1.select * from a where email not in (select email from b) and email not in(elect email from c)
lz这样不好使么。
[解决办法]
select * from a
where not exists(select 1 from b where a.email=b.email)
and not exists(select 1 from c where a.email=c.email)
[解决办法]
select * from a where not exists(select 1 from b where a.email=b.email)and not exists(select 1 from c where a.email=c.email)select a.* from a join bon a.email=b.emailjoin con a.email=c.emailwhere b.email is null and c.email is null