The four ranking functions were introduced to T-SQL by Microsoft in 2005. Three of the functions, ROW_NUMBER, RANK, and DENSE_RANK, assign a sequential number to each row in a query’s results. The fourth ranking function, NTILE, divides the rows by assigning a bucket number to each row in the results. The group of low-ranking rows gets an NTILE value of 1 while the highest-ranking group of rows is assigned the top number.
While adding ...