解决方案
5
select from A where exists(select 1 from B where a.id = b.id and b.zhizhuangtai=4 ) and a.zhuangtai = 1
5
SELECT DISTINCT(a.ID), a.zhuangtai FROM a LEFT JOIN b ON a.ID = b.ID WHERE a.zhuangtai = “1” AND b.zhuangtai = “4”
LZ试试这个,望采纳
LZ试试这个,望采纳
30
select *
from a
where a.zhant=1 and not exists (select 1 from b where id=a.id and b.zt!=4)
from a
where a.zhant=1 and not exists (select 1 from b where id=a.id and b.zt!=4)