select user
from your_table
where service in (4,5)
and active = TRUE
group by user
having count(distinct service) = 2
或者
select user
from your_table
group by user
having sum(active = TRUE and service = 4) > 0
and sum(active = TRUE and service = 5) > 0
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句