I am using a data set in SQL like the first three columns. What I want to add is another column called rank
. That will provide me the rank of that class in that specific year. I honestly don't know where to start. Does anyone know how to solve the issue? Thanks!
class year grade rank
A 2015 21 3
A 2016 22 2
A 2017 23 1
B 2015 27 1
B 2016 25 2
B 2017 24 3
C 2015 22 3
C 2016 28 2
C 2017 29 1
You would use
rank()
: