MySQL 三个表 多重嵌套

#找出没有销售过red公司产品的销售员
select name
from salesperson
where sales_id not in(
select sales_id
# 在订单表找到了公司包含red的销售的id
from orders
where com_id in
(
# 在公司表找到了red公司的公司编码
select com_id
from company
where name ='red'));

posted @ 2025-04-15 18:39  胖豆芽  阅读(11)  评论(0)    收藏  举报