题解 | 用户订单信息查询
用户订单信息查询
https://www.nowcoder.com/practice/dccec8456d774169925c0d50843ea076
SELECT
c.city,
SUM(o.total_amount) AS total_order_amount
FROM
orders AS o
INNER JOIN
customers AS c ON o.customer_id=c.customer_id
GROUP BY
c.city
ORDER BY
total_order_amount DESC,
c.city ASC;
查看6道真题和解析