1625. Group Sold Products By The Date
My accepted SQL solution to LeetCode problem 1625, Group Sold Products By The Date, running in 439ms.
- Difficulty: Easy
- SQL
- Runtime 439ms
- Memory 0.0B
- Updated
Read the problem on LeetCode View on GitHub
The problem statement is LeetCode’s and stays on their site. What follows is my accepted solution.
SQL
Accepted on LeetCode — runtime 439ms, memory 0.0B, accepted 2025-12-29.
SELECT sell_date,
COUNT(DISTINCT product) AS num_sold,
GROUP_CONCAT(DISTINCT product ORDER BY product SEPARATOR ',') AS products
FROM Activities
GROUP BY sell_date
ORDER BY sell_date