You may need to play with the order by and the second 1 (sort column ) in the CSUM function to get the rows ordered the way you want.
The RANK function also works:
Select Name, RANK(Name)
From Table1
Oder By 1;
The problem with RANK is the ranking column MUST BE unique for the values to be unique, for exampl if two people have the nane Smith, they both get the same RANK.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.