Your SQL University
Home » Interview Q & A » Q13. What is the basic difference between ROW_NUMBER, RANK and DENSE_RANK functions?
ROW_NUMBER: It just returns the sequence numbers starts from 1.
RANK: Returns the rank of each record in the current result set.
DENSE_RANK: It is same as Rank() function. But it returns without gaps in ranking.
Do not worry about these definitions 🙂 Please look at the below data and respective ranks. You will be able to understand the actual difference between them.
Tags: DENSE_RANK, RANK, Ranking Functions, ROW_NUMBER
Fill in your details below or click an icon to log in:
You are commenting using your WordPress.com account. ( Log Out / Change )
You are commenting using your Twitter account. ( Log Out / Change )
You are commenting using your Facebook account. ( Log Out / Change )
You are commenting using your Google+ account. ( Log Out / Change )
Connecting to %s
Notify me of new comments via email.
Please visit SQLVERSITY.COM for more details.
Blog at WordPress.com.