O'Reilly logo

Inside Microsoft® SQL Server® 2008: T-SQL Querying by Lubor Kollar Itzik Ben-Gan Dejan Sarka, and Steve Kass

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Analytical Ranking Functions

SQL Server supports four analytical ranking functions: ROW_NUMBER, RANK, DENSE_RANK, and NTILE. These functions provide a simple and highly efficient way to produce ranking calculations. I will also demonstrate alternative solutions to producing ranking values without the built-in ranking functions. Of course, you can feel free to skip the coverage of the alternative solutions, but I’d recommend spending the time to learn those for several reasons. A lot of existing legacy code out there in production systems makes use of those techniques. Also, some of those techniques are quite convoluted, and some have poor performance, so by being familiar with them you gain a greater appreciation for the simplicity and efficiency ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required