Tutorial: SQL Analytic Functions
SQL analytic ("window") functions compute a value for each row of input based on other rows, collectively known as a "window". The window is defined using OVER and can be refined using PARTITION BY, ORDER BY, and ROWS/RANGE BETWEEN. The value can be from a numbering function, navigational function, or an aggregate analytic function. To learn more, check out my Youtube video. For a text reference, BigQuery's article " Analytic function concepts in Standard SQL " is a great resource. Below, you can find the text referenced in the Youtube video, as well as some bonus content not in the video.