Tag Archives: Ranking Functions

Notes on the OVER Clause in Sql Server Ranking Functions

This article only deals with a couple of points so I’ll keep it short.

FIRST_VALUE, LAST_VALUE
FIRST_VALUE is a very useful ranking function and works predictably. LAST_VALUE is also useful but may give you surprises. You can ignore LAST_VALUE if you want, and just re-use FIRST_VALUE: Continue reading Notes on the OVER Clause in Sql Server Ranking Functions

CROSS APPLY with Ranking and Analytical Functions

As I posted here, I’m very interested in using CROSS APPLY in a new way to keep down clutter in sql statements with complex column expressions. I recently found a limitation. I think I’ve figured out why, and since understanding reduces frustration I’m posting it here. Continue reading CROSS APPLY with Ranking and Analytical Functions