文章目录
-
- 原题题目
- 代码实现(首刷自解)
原题题目
代码实现(首刷自解)
# Write your MySQL query statement below
SELECT month,order_count,customer_count
FROM (SELECT DATE_FORMAT(order_date,"%Y-%m") AS month,COUNT(DISTINCT order_id) AS order_count,COUNT(DISTINCT customer_id) AS customer_countFROM ordersWHERE invoice > 20GROUP BY DATE_FORMAT(order_date,"%Y-%m")) t