求一个sql语句,筛选出指定要求的数据。

2024-12-27 04:44:43
推荐回答(2个)
回答1:

比如表Table
select * from Table t where
exists (select * from Table a where A='N' and t.id = a.id) and
exists (select * from Table b where B='N' and t.id = b.id) and
exists (select * from Table c where C='N' and t.id = c.id) ;

回答2:

shit有那么复杂吗
select * from t where t.状态='N'