File tree Expand file tree Collapse file tree 3 files changed +3
-3
lines changed
solution/3200-3299/3214.Year on Year Growth Rate Expand file tree Collapse file tree 3 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -138,7 +138,7 @@ transaction_id 列唯一标识了表中的每一列。
138
138
# Write your MySQL query statement below
139
139
WITH
140
140
T AS (
141
- SELECT product_id, year (transaction_date) year, SUM (spend) tot_spend
141
+ SELECT product_id, YEAR (transaction_date) year, SUM (spend) tot_spend
142
142
FROM user_transactions
143
143
GROUP BY 1 , 2
144
144
),
Original file line number Diff line number Diff line change @@ -137,7 +137,7 @@ We can first group by `product_id` and `year(transaction_date)` to perform the s
137
137
# Write your MySQL query statement below
138
138
WITH
139
139
T AS (
140
- SELECT product_id, year (transaction_date) year, SUM (spend) tot_spend
140
+ SELECT product_id, YEAR (transaction_date) year, SUM (spend) tot_spend
141
141
FROM user_transactions
142
142
GROUP BY 1 , 2
143
143
),
Original file line number Diff line number Diff line change 1
1
# Write your MySQL query statement below
2
2
WITH
3
3
T AS (
4
- SELECT product_id, year (transaction_date) year, SUM (spend) tot_spend
4
+ SELECT product_id, YEAR (transaction_date) year, SUM (spend) tot_spend
5
5
FROM user_transactions
6
6
GROUP BY 1 , 2
7
7
),
You can’t perform that action at this time.
0 commit comments