leetcode-607. 销售员
这个有点像是写离线查询了
# Write your MySQL query statement below
select sp.name from (
select sales_id, name from
SalesPerson
) sp left outer join (
select sales_id, com_id
from Orders
) o on (o.sales_id = sp.sales_id) left outer join (
select com_id, name
from Company
where name = 'RED'
) c on (o.com_id = c.com_id)
group by sp.name
having count(c.com_id) <= 0
本文来自博客园,作者:吴丹阳-V,转载请注明原文链接:https://www.cnblogs.com/wudanyang/p/17019916.html