SQL每日一题(20210906)
SQL每日一题(20220215)
select stuid
from (select *, if(cid in ('001', '003'), 1, 0) s from T0609) s
group by stuid
having sum(s) = 2
select stuid from T0609 where cid in('001','003') group by stuid having count(stuid) =2
SQL每日一题(20210906)
SQL每日一题(20220215)
select stuid
from (select *, if(cid in ('001', '003'), 1, 0) s from T0609) s
group by stuid
having sum(s) = 2
select stuid from T0609 where cid in('001','003') group by stuid having count(stuid) =2