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 customers;

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

SELECT
  row_number() OVER (ORDER BY created_at),
  *
FROM customers;