Community

Medians, ROW_NUMBERs, and performance

(Adam Machanic) A couple of days ago, Aaron Bertrand posted about a method for calculating medians in SQL Server 2005 using the ROW_NUMBER function in conjunction with the COUNT aggregate. This method (credited to Itzik Ben-Gan) is interesting, but I discovered an even better way to attack the probl

Read More - Register for Free Membership