Leetcode Note: MySQL - Daily Leads and Partners

Daily Leads and Partners - LeetCode
https://leetcode.com/problems/daily-leads-and-partners/

  • MySQL で取り組んだメモ

回答

Simple MySQL solution using COUNT DISTINCT - Daily Leads and Partners - LeetCode
https://leetcode.com/problems/daily-leads-and-partners/solutions/976703/simple-mysql-solution-using-count-distinct/

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