文章目录
原题题目
代码实现(首刷自解)
# 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_count
FROM orders
WHERE invoice > 20
GROUP BY DATE_FORMAT(order_date,"%Y-%m")) t