In this article, I am going to discuss Rank and Dense_Rank Function in SQL Server with Examples. RANK and DENSE_RANK Function in SQL Server: Both the RANK and DENSE_RANK functions were introduced in SQL Server 2005. Again both these functions are used to return sequential numbers starting from 1 based on the ordering of rows imposed by the ORDER BY clause. Let us first understand these functions in detail with some examples and then we will try to understand the difference between them. Note: When you have two records with the same data, then it will give the same rank to both the rows. RANK Function in SQL Server: The following is the syntax to use the RANK function in SQL Server. As you can see, like the Row_Number function, here also the Partition By clause is optional while the Order By Clause is mandatory. The PARTITION BY clause is basically used to partition the result set into multiple groups. As it is optional, and if you did not specify the PARTI...