자료구조 알고리즘/코딩테스트

1581. Customer Who Visited but Did Not Make Any Transactions

내공얌냠 2022. 6. 3. 13:12

https://leetcode.com/problems/customer-who-visited-but-did-not-make-any-transactions/

 

Customer Who Visited but Did Not Make Any Transactions - 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

문제 이해하는 데 오래걸렸다.

처음에는 이해를 못해서 discussion 으로 찾아보았고,

그래도 모르겠어서 다음날 다시 도전했더니 이해가 되었다.

select v.customer_id, count(v.customer_id) as count_no_trans
from Visits as v
where visit_id not in (select distinct visit_id from Transactions)
group by customer_id;

 

728x90
반응형