Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何选择与所有子公司签订合同的客户?
R2 UID | Subsidiary 1 | 1 1 | 2 1 | 3 2 | 1 2 | 2 3 | 1 3 | 1
你能帮我解决这个问题吗?
像这样的东西:
select u_r2.uid from (select uid , count(distinct subsidiary) as u_subs from r2 group by uid ) u_r2 , (select count (distinct subsidiary) as tot_subs from r2) sub_r2 where sub_r2.tot_subs = u_r2.u_subs;