Analytical Ranking Functions
SQL Server 2005 introduces four new analytical ranking functions: ROW_NUMBER, RANK, DENSE_RANK, and NTILE. These functions provide a simple and highly efficient way to produce ranking calculations.
ROW_NUMBER is by far my favorite enhancement in SQL Server 2005. Even though it might not seem that significant on the surface compared to other enhancements (for example, recursive queries), it has an amazing number of practical applications that extend far beyond classic ranking and scoring calculations. I have been able to optimize many solutions by using the ROW_NUMBER function, as I will demonstrate throughout the book.
Even though the other ranking functions are technically calculated similarly to ROW_NUMBER underneath ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access