Skip to content

Commit 37f70c6

Browse files
authored
feat: add sql solution to lc problem: No.1484 (doocs#777)
No.1484.Group Sold Products By The Date
1 parent 6de3c70 commit 37f70c6

File tree

3 files changed

+30
-2
lines changed

3 files changed

+30
-2
lines changed

solution/1400-1499/1484.Group Sold Products By The Date/README.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,16 @@ Result 表:
6464
### **SQL**
6565

6666
```sql
67-
67+
SELECT
68+
sell_date,
69+
COUNT(DISTINCT product) AS num_sold,
70+
GROUP_CONCAT(DISTINCT product
71+
ORDER BY product ASC
72+
SEPARATOR ',') AS products
73+
FROM
74+
Activities
75+
GROUP BY sell_date
76+
ORDER BY sell_date ASC;
6877
```
6978

7079
<!-- tabs:end -->

solution/1400-1499/1484.Group Sold Products By The Date/README_EN.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,16 @@ For 2020-06-02, the Sold item is (Mask), we just return it.
6565
### **SQL**
6666

6767
```sql
68-
68+
SELECT
69+
sell_date,
70+
COUNT(DISTINCT product) AS num_sold,
71+
GROUP_CONCAT(DISTINCT product
72+
ORDER BY product ASC
73+
SEPARATOR ',') AS products
74+
FROM
75+
Activities
76+
GROUP BY sell_date
77+
ORDER BY sell_date ASC;
6978
```
7079

7180
<!-- tabs:end -->
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
SELECT
2+
sell_date,
3+
COUNT(DISTINCT product) AS num_sold,
4+
GROUP_CONCAT(DISTINCT product
5+
ORDER BY product ASC
6+
SEPARATOR ',') AS products
7+
FROM
8+
Activities
9+
GROUP BY sell_date
10+
ORDER BY sell_date ASC;

0 commit comments

Comments
 (0)