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

Rank Without Window Functions

Compute each student's rank within their class (1 = highest, ties share a rank, next rank skipped) without window functions. Order by class, rank, name.

Table schema

Students(name VARCHAR(10), class VARCHAR(5), score INT)

Sample data

name | class | score
Ann | X | 90
Bob | X | 90
Cy | X | 70
Dee | Y | 60
Eli | Y | 80

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.