[코드카타] SQL 23 Customer Who Visited but Did Not Make Any Transactions

Data_Student·2024년 11월 7일
0

코드카타

목록 보기
30/57

[코드카타] SQL 23 Customer Who Visited but Did Not Make Any Transactions

23. Customer Who Visited but Did Not Make Any Transactions
https://leetcode.com/problems/customer-who-visited-but-did-not-make-any-transactions/

Write a solution to find the IDs of the users who visited without making 
any transactions and the number of times they made these types of visits.
Return the result table sorted in any order.
select  customer_id, count(*) count_no_trans
from visits a left join Transactions b on a.visit_id = b.visit_id
where transaction_id is null
group by customer_id
where조건으로 null값만 추출후 count 하기!

0개의 댓글