题解 | 用户订单信息查询

用户订单信息查询

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;

全部评论

相关推荐

评论
1
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务