[MySQL][LeetCode][Easy] 183. Customers Who Never Order

心得

這題要show出沒有訂過東西的客戶,所以可以使用LEFT JOIN來關聯兩張表。

問題

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.

Table: Orders.

Using the above tables as example, return the following:

答案

  1. LEFT JOIN
  2. Sub Query


這裡的資訊對您有用嗎?請我飲一杯咖啡?