What is the difference between ROW_NUMBER() and RANK() when there are tied values?

SQL Data Analyst Medium

SQL Data Analyst — Medium

What is the difference between ROW_NUMBER() and RANK() when there are tied values?

Key points

  • ROW_NUMBER() provides unique sequential integers
  • RANK() assigns the same rank to tied values
  • RANK() skips subsequent numbers after ties
  • ROW_NUMBER() does not skip numbers after ties

Ready to go further?

Related questions