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

The window and OVER

Five menu cards in a row, each under a max window frame showing the tallest bar; an OVER () tag above

In chapter six, aggregates collapsed the table: max(price) over the whole menu gave one row with one number. But you often need something else: keep every item in place and write the top price next to it. For example, to show how much cheaper each coffee is than the most expensive one.

In this lesson

  • A window over the whole table
  • The window sees rows after WHERE
  • A window value in calculations
  • Common mistake
  • Key points