ice rabbit programming

[LeetCode] Customers Who Never Order 본문

PS/LeetCode

[LeetCode] Customers Who Never Order

판교토끼 2020. 4. 26. 21:48

https://leetcode.com/problems/customers-who-never-order/

 

Customers Who Never Order - LeetCode

Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview.

leetcode.com

SQL을 사용하는 문제를 간만에 풀었다. 어려운 문제는 아니고 JOIN과 NOT IN으로 차집합을 구하는 문제였다.

# Write your MySQL query statement below
SELECT Customers.Name AS Customers
From Customers
WHERE Customers.Id NOT IN
(SELECT Customers.Id AS Customers
From Customers JOIN Orders
ON Customers.Id=Orders.CustomerId);

'PS > LeetCode' 카테고리의 다른 글

[LeetCode] Reverse Linked List  (0) 2020.04.27
[LeetCode] Combine Two Tables  (0) 2020.04.27
[LeetCode] Add Binary  (0) 2020.04.23
[LeetCode] Same Tree  (0) 2020.04.22
[LeetCode] Majority Element  (0) 2020.04.21