The Smart Guide to Building World-Class Applications
By Kristen Cheyney, 05/14/2009
Using a looping algorithm to determine the average number of days between orders can be painfully slow code to write and run. A better approach is to use the ROW_NUMBER function.