今日成果:
select *
from clients
where client_id in (
select client_id
from invoices
group by client_id
having count(*) >=2
);
-- 另一种写法
select *
from clients
where client_id = any (
select client_id
from invoices
group by client_id
having count(*) >=2
);
-- 查询大于2张发票的用户
感谢各位读者查阅,欢迎各位👍点赞✍评论⭐收藏+关注!