题解 | 电商平台想要了解不同商品在不同月份的销售趋势
电商平台想要了解不同商品在不同月份的销售趋势
https://www.nowcoder.com/practice/a3fab87aca9347c28f406088cf601c7b
select p.product_id,product_name,sum(quantity) total_sales,max(quantity) max_monthly_sales, min(quantity) min_monthly_sales,round(avg(quantity),0) avg_monthly_sales from products_underline p join sales_underline s on p.product_id = s.product_id where sale_month between '2024-01' and '2024-06' group by p.product_id
