What is s on the row (1,1)?
-- t(d, x): (1,1), (1,2), (2,3) SELECT d, x, SUM(x) OVER (ORDER BY d) AS s FROM t;
- 1
- 6
- 2
- 3
The default frame is
Play SQL & Databases ▸
RANGE ... CURRENT ROW, which includes peers with the same d, so both d=1 rows sum to 3.