Skip to content

Commit 3d4336e

Browse files
committed
Customers_Who_Never_Order
1 parent b7f3e59 commit 3d4336e

File tree

4 files changed

+24
-0
lines changed

4 files changed

+24
-0
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
SELECT Name Customers
2+
FROM Customers A
3+
WHERE NOT EXISTS (
4+
SELECT 1
5+
FROM Orders B
6+
WHERE A.Id = B.CustomerId
7+
)
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
SELECT Name Customers
2+
FROM Customers A
3+
WHERE A.Id NOT IN (
4+
SELECT B.CustomerId
5+
FROM Orders B
6+
)
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
SELECT Name Customers
2+
FROM Customers a LEFT JOIN Orders b ON a.Id = b.CustomerId
3+
WHERE CustomerId is NULL
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
## 183. Customers Who Never Order (Easy)
2+
3+
### **链接**
4+
题目:https://leetcode.com/problems/customers-who-never-order/
5+
代码(github):https://github.com/illuz/leetcode
6+
7+
### **题意**
8+
从两个表中得到从没买过东西的家伙。

0 commit comments

Comments
 (0)