题解 | #计算商城中2021年每月的GMV#
计算商城中2021年每月的GMV
http://www.nowcoder.com/practice/5005cbf5308249eda1fbf666311753bf
SELECT
DATE_FORMAT(event_time,'%Y-%m') AS month,
SUM(total_amount) AS GMV
FROM tb_order_overall
WHERE YEAR(event_time)='2021' AND status!=2
GROUP BY DATE_FORMAT(event_time,'%Y-%m')
HAVING GMV>100000
ORDER BY GMV