융무의 기술블로그
article thumbnail

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

Problem                                                                                                                      

Analysis                                                                                                                     

1.  Orders table을 LEFT JOIN 시킨다

 

2. 여기서 참조키가 아닌 것들으 NULL로 나오기 때문에 NULL인 부분을 찾는다

 

Solution                                                                                                                    

SELECT C.Name AS Customers 
FROM Customers AS C
LEFT JOIN Orders AS O ON C.Id = O.CustomerId
WHERE O.ID IS NULL 
profile

융무의 기술블로그

@융무

포스팅이 좋았다면 "좋아요❤️" 또는 "구독👍🏻" 해주세요!