题解 | #计算总和#
计算总和
https://www.nowcoder.com/practice/d8a624021183454586da94d280cc8046
select order_num,sum(item_price*quantity) as total_price from OrderItems group by order_num having total_price >=1000 order by order_num
知识点:
1、这个题在上题基础上增加了 sum() 内的行计算。
2、聚合函数内可以是列,也可以是表达式。