题解 | #返回订单数量总和不小于100的所有订单的订单号#
返回订单数量总和不小于100的所有订单的订单号
http://www.nowcoder.com/practice/ff77e82b59544a15987324e19488aafd
SELECT order_num
from
(select *,
sum(quantity) over (partition by order_num ) a
FROM OrderItems) b
from
(select *,
sum(quantity) over (partition by order_num ) a
FROM OrderItems) b
where a >100
窗口函数解法,注意窗口 函数只能放在select子句中,具体解释可查 https://blog.csdn.net/ljh18885466426/article/details/119896641