2022/5/3 SQL 607.销售员

102 阅读1分钟

解决思路

每次在一个表中用一个筛选关系找到符合条件的某个参数,然后逐步接近销售员的名字这个参数

过程记录

想到了用嵌套,但是最后没写出正确版本

题解

select name from

salesperson

where sales_id not in

(select sales_id from orders where com_id in

(select com_id from company where name='RED')

);