Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Window Functions

Generate a row_number column to enumerate rows:

SELECT
  row_number() OVER (),
  *
FROM penguins;

Generate a row_number column to enumerate rows, ordered by bill_length_mm:

SELECT
  row_number() OVER (ORDER BY bill_length_mm),
  *
FROM penguins;