
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')
)
这个思想很简单,先查询公司名为red的公司的id 然后根据id查询公司的销售员id
然后查询id不为之前查询出id的销售员名字
博客介绍了一个SQL查询思路,先查询公司名为red的公司id,再依据该id查询公司的销售员id,最后查询id不为之前所查id的销售员名字。

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')
)
这个思想很简单,先查询公司名为red的公司的id 然后根据id查询公司的销售员id
然后查询id不为之前查询出id的销售员名字
129
880

被折叠的 条评论
为什么被折叠?