[LeetCode] Daily Leads and Partners
Problem 1693. Daily Leads and Partners
- 難易度:Easy
- LeetCode Link
Concept
COUNT
関数に DISTINCT
を使うことで、重複を排除したカウントする
Code
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
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
Author And Source
この問題について([LeetCode] Daily Leads and Partners), 我々は、より多くの情報をここで見つけました https://qiita.com/z6wdc/items/5f05f65f1ba9f5023713著者帰属:元の著者の情報は、元のURLに含まれています。著作権は原作者に属する。
Content is automatically searched and collected through network algorithms . If there is a violation . Please contact us . We will adjust (correct author information ,or delete content ) as soon as possible .