728x90
https://leetcode.com/problems/customer-who-visited-but-did-not-make-any-transactions/
SELECT A.customer_id, COUNT(A.visit_id) AS count_no_trans
FROM Visits as A
LEFT JOIN Transactions as B
ON A.visit_id = B.visit_id
WHERE B.transaction_id IS NULL
GROUP BY A.customer_id;
728x90
'IT > 코딩테스트' 카테고리의 다른 글
[Leetcode] 577. Employee Bonus (0) | 2023.09.01 |
---|---|
[Leetcode] 197. Rising Temperature (0) | 2023.08.31 |
[Leetcode] 1683. Invalid Tweets (0) | 2023.08.29 |
[Leetcode] 1148. Article Views I (0) | 2023.08.29 |
[Leetcode] 2356. Number of Unique Subjects Taught by Each Teacher (0) | 2023.08.28 |