Skip to content

Commit acfae94

Browse files
authored
Create 1070-product-sales-analysis-iii.sql
1 parent 0331a7a commit acfae94

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

1070-product-sales-analysis-iii.sql

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Write your MySQL query statement below
2+
select sub.product_id,
3+
sub.first_year,
4+
S.quantity,
5+
S.price
6+
from (select product_id,
7+
min(year) as first_year
8+
from Sales
9+
group by product_id) sub,
10+
Sales S
11+
where S.product_id = sub.product_id
12+
and S.year = sub.first_year

0 commit comments

Comments
 (0)