LEFT JOIN
카테고리 : SQL >> Sqlpractice Hashtag : #Sql #Data_analytics #Mysql #Infrean #Reetcode
Infrean 데이터 분석을 위한 중급 SQL 강의 복습 정리
01. 183 - Customers Who Never Order
- 활용 테이블 (Customers, Orders)
Write an SQL query to report all customers who never order anything.
Return the result table in any order.
-- 내 문제 풀이(정답)
SELECT name as Customers
FROM Customers as C
LEFT JOIN Orders as O ON C.id = O.customerId
WHERE ISNULL(O.id);
-- WHERE O.id IS NULL 도 된다.