Skip to content

Commit b2cba08

Browse files
committed
fix: update
1 parent a0c54b2 commit b2cba08

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

solution/3200-3299/3214.Year on Year Growth Rate/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,12 +138,12 @@ transaction_id 列唯一标识了表中的每一列。
138138
# Write your MySQL query statement below
139139
WITH
140140
T AS (
141-
SELECT product_id, YEAR(transaction_date) year, SUM(spend) tot_spend
141+
SELECT product_id, YEAR(transaction_date) year, SUM(spend) curr_year_spend
142142
FROM user_transactions
143143
GROUP BY 1, 2
144144
),
145145
S AS (
146-
SELECT t1.year, t1.product_id, t1.tot_spend curr_year_spend, t2.tot_spend prev_year_spend
146+
SELECT t1.year, t1.product_id, t1.curr_year_spend, t2.curr_year_spend prev_year_spend
147147
FROM
148148
T t1
149149
LEFT JOIN T t2 ON t1.product_id = t2.product_id AND t1.year = t2.year + 1

solution/3200-3299/3214.Year on Year Growth Rate/README_EN.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,12 +137,12 @@ We can first group by `product_id` and `year(transaction_date)` to perform the s
137137
# Write your MySQL query statement below
138138
WITH
139139
T AS (
140-
SELECT product_id, YEAR(transaction_date) year, SUM(spend) tot_spend
140+
SELECT product_id, YEAR(transaction_date) year, SUM(spend) curr_year_spend
141141
FROM user_transactions
142142
GROUP BY 1, 2
143143
),
144144
S AS (
145-
SELECT t1.year, t1.product_id, t1.tot_spend curr_year_spend, t2.tot_spend prev_year_spend
145+
SELECT t1.year, t1.product_id, t1.curr_year_spend, t2.curr_year_spend prev_year_spend
146146
FROM
147147
T t1
148148
LEFT JOIN T t2 ON t1.product_id = t2.product_id AND t1.year = t2.year + 1

solution/3200-3299/3214.Year on Year Growth Rate/Solution.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# Write your MySQL query statement below
22
WITH
33
T AS (
4-
SELECT product_id, YEAR(transaction_date) year, SUM(spend) tot_spend
4+
SELECT product_id, YEAR(transaction_date) year, SUM(spend) curr_year_spend
55
FROM user_transactions
66
GROUP BY 1, 2
77
),
88
S AS (
9-
SELECT t1.year, t1.product_id, t1.tot_spend curr_year_spend, t2.tot_spend prev_year_spend
9+
SELECT t1.year, t1.product_id, t1.curr_year_spend, t2.curr_year_spend prev_year_spend
1010
FROM
1111
T t1
1212
LEFT JOIN T t2 ON t1.product_id = t2.product_id AND t1.year = t2.year + 1

0 commit comments

Comments
 (0)