数据库查询-从不订购的客户

解题思路:

查出orders表里的客户id,与customer表的用户对比,不在表里的客户id就是从不订购东西的用户

此处的知识点是:select * form table_name where value in +条件

select name as Customers from Customers c where c.id not in(select CustomerId from Orders )

猜你喜欢

转载自blog.csdn.net/angryshan/article/details/82729024