题解 | 电商平台想要了解不同商品在不同月份的销售趋势
电商平台想要了解不同商品在不同月份的销售趋势
https://www.nowcoder.com/practice/a3fab87aca9347c28f406088cf601c7b
select
pu.product_id,
product_name,
sum(quantity) as total_sales,
max(quantity) as max_monthly_sales,
min(quantity) as min_monthly_sales,
round(avg(quantity),0) as avg_monthly_sales
from
products_underline pu
join
sales_underline su
on
pu.product_id = su.product_id
where
sale_month < '2024-07' and sale_month >= '2024-01'
group by
pu.product_id,
product_name
order by
pu.product_id;
SHEIN希音公司福利 370人发布