Skip to content
Theory · Window functions · lesson 4 of 12

ROW_NUMBER, RANK, DENSE_RANK

The coffee shop is preparing a "Most expensive drinks" display and wants to label the places: first, second, third. ORDER BY at the end of a query puts the rows in order, but no place number appears in them. The number has to be computed.

In this lesson

  • ORDER BY inside OVER
  • Three ways to hand out places
  • Numbering within a partition
  • Common mistake
  • Key points