题解 | #计算总和#
计算总和
http://www.nowcoder.com/practice/d8a624021183454586da94d280cc8046
SELECT order_num,SUM(item_price*quantity) AS total_price
FROM OrderItems
GROUP BY order_num
HAVING SUM(item_price*quantity)>=1000
ORDER BY order_num;
计算总和
http://www.nowcoder.com/practice/d8a624021183454586da94d280cc8046
SELECT order_num,SUM(item_price*quantity) AS total_price
FROM OrderItems
GROUP BY order_num
HAVING SUM(item_price*quantity)>=1000
ORDER BY order_num;
相关推荐