What is run on the row with id 2?
-- t(id, x): (1,1), (2,2), (3,3) SELECT id, SUM(x) OVER (ORDER BY id) AS run FROM t;
- 3
- 1
- 2
- 6
With
Play SQL & Databases ▸
ORDER BY the window is a running total: 1 + 2 = 3 at id 2.