题解 | #连续两次作答试卷的最大时间窗#
计算商城中2021年每月的GMV
http://www.nowcoder.com/practice/5005cbf5308249eda1fbf666311753bf
SELECT
DATE_FORMAT(event_time,'%Y-%m') month
,round(sum(total_amount)) GMV
from tb_order_overall
where status<2
and year(event_time)=2021
group by month
having GMV>100000
DATE_FORMAT(event_time,'%Y-%m') month
,round(sum(total_amount)) GMV
from tb_order_overall
where status<2
and year(event_time)=2021
group by month
having GMV>100000
order by GMV
这题还是比较简单的。