Snoopy [리트코드/SQL] 22. Find Followers Count (1729)
코딩테스트/리트코드 SQL

[리트코드/SQL] 22. Find Followers Count (1729)

Sooyoon Jeong 2022. 12. 18.

🤔 문제 분석

1) Write an SQL query that will, for each user, return the number of followers.

2) Return the result table ordered by user_id in ascending order.

 

💡 풀이

SELECT date_id, make_name, 
	   COUNT(DISTINCT lead_id) AS unique_leads, 
	   COUNT(DISTINCT partner_id) AS unique_partners
FROM DailySales
GROUP BY date_id, make_name

 

댓글