题解 | #确定最佳顾客的另一种方式(二)#

确定最佳顾客的另一种方式(二)

http://www.nowcoder.com/practice/b5766f970ae64ac7944f37f5b47107aa

SELECT c.cust_name,SUM(a.item_price*a.quantity) AS total_price FROM OrderItems a INNER JOIN Orders b ON a.order_num = b.order_num INNER JOIN Customers c ON b.cust_id=c.cust_id GROUP BY c.cust_name HAVING total_price>1000 ORDER BY total_price ASC;

全部评论

相关推荐

点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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