Skip to content

Instantly share code, notes, and snippets.

@romain9292
Created August 16, 2022 13:04
Show Gist options
  • Save romain9292/97dc4a3cfc94d86ff0cf2cd49b99d55e to your computer and use it in GitHub Desktop.
Save romain9292/97dc4a3cfc94d86ff0cf2cd49b99d55e to your computer and use it in GitHub Desktop.
[Numbering Functions - Row Number 3] Differences between numbering functions in BigQuery using SQL #SQL #BigQuery
SELECT
*,
ROW_NUMBER() OVER(PARTITION BY product_category ORDER BY revenue DESC) AS row_number
FROM
`datastic.ranking.base_table`;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment