Skip to content

Commit 9372073

Browse files
committed
Update 1484. Group Sold Products By The Date.SQL
1 parent 30cd214 commit 9372073

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

LeetCode SQL 50 Solution/1484. Group Sold Products By The Date.SQL

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,12 @@ Output:
5353
Explanation:
5454
For 2020-05-30, Sold items were (Headphone, Basketball, T-shirt), we sort them lexicographically and separate them by a comma.
5555
For 2020-06-01, Sold items were (Pencil, Bible), we sort them lexicographically and separate them by a comma.
56-
For 2020-06-02, the Sold item is (Mask), we just return it.
56+
For 2020-06-02, the Sold item is (Mask), we just return it.
57+
58+
59+
60+
select sell_date, count( DISTINCT product ) as num_sold ,
61+
62+
GROUP_CONCAT( DISTINCT product order by product ASC separator ',' ) as products
63+
64+
FROM Activities GROUP BY sell_date order by sell_date ASC;

0 commit comments

Comments
 (0)