리트코드(LeetCode) SQL 문제풀이 - 1581. Customer Who Visited but Did Not Make Any Transactions

2023. 1. 23. 20:48코딩테스트/리트코드(LeetCode) - SQL Study Plan

MySQL 문제 1581. Customer Who Visited but Did Not Make Any Transactions

select customer_id,count(customer_id) as count_no_trans 
    from Visits
    where visit_id NOT IN (
        select DISTINCT visit_id
            from Transactions)
    group by customer_id;
728x90