SQL window function table
Compare row number, rank, dense rank and running sums for grouped numeric rows. Inspect ties and partition boundaries without executing SQL.
The example value has been entered. Check it immediately or change the value.
Input is processed in the browser. Refreshing returns a sample value.
Instructions and example
Sort by group then value ascending. Ties retain input order; running sum follows ROWS UNBOUNDED PRECEDING.
For 10,10,20, ranks are 1,1,3; dense ranks 1,1,2; running sums 10,20,40.
Up to 100 rows with string group and finite numeric value. Columns: group, value, row number, rank, dense rank, running sum.
Frequently asked questions
Why does rank skip numbers after ties?
Rank uses the peer group’s first row number; dense_rank counts distinct value groups.
Do tied rows share the same running sum?
No. This tool uses a ROWS frame and adds each row in stable input order.
Calculation criteria and reference materials
- PostgreSQL — Window functions
Sort by group then value ascending. Ties retain input order; running sum follows ROWS UNBOUNDED PRECEDING.
Verification of calculation criteria: · Calculation·verification principles · Report errors