SQL windows functions


> Syntax


























Mock hospital dataset


























Example/1: average number of patients per department/month?




























Example/2: Compare with GROUP BY aggregate functions:


> Windows functions do not collapse input rows into a single output row (compare with aggregate functions).