Skip to main content
Admissions guidance, study banks, and career tools — get started on Shalyam

RANGE vs ROWS Running Total

Return each row's day, amount and the running total computed with the default RANGE frame ordered by day, so rows with the same day share the same running total. Order by day, then amount.

Table schema

Sales(day INT, amount INT)

Sample data

day | amount
1 | 10
2 | 20
2 | 30
3 | 40

Discussion

No discussions yet.

Rewards · v2.1

Get Exclusive Insights with Every Issue

Join Shalyam Newsletter

Stay ahead in education, research, and innovation—straight to your inbox.