Rank

Database Table Design

How to Rank Results in SQL Server

Wouldn't it be nice to get away from using temporary tables to rank query results in SQL Server? The rank functions can help you accomplish this very easily. There are four rank functions: ROW_NUMBER, RANK, DENSE_RANK, and NTILE.