Suppose that a website contains two tables, the Customers
table and the Orders
table. Write a SQL query to find all customers who never order anything.
Table: Customers
.
1 | +----+-------+ |
Table: Orders
.
1 | +----+------------+ |
Using the above tables as example, return the following:
1 | +-----------+ |
子查询
先从Orders
里面找出所有购买过东西的顾客id组成一个集合A, 然后再判断customer里的每个顾客是否在A中.
1 | # Write your MySQL query statement below |