Here are the key enhancements to the OVER clause in SQL Server 2012:
- Ability to specify both PARTITION BY and ORDER BY clauses, allowing window functions to operate over ordered partitions of data. This enables more advanced windowing scenarios.
- New window frame specifications - RANGE and ROWS, which allow window functions to consider rows before and/or after the current row within the partition. This enables window functions like moving averages.
- Ability to use window functions with aggregate functions like SUM(), COUNT(), etc. This allows calculations like cumulative sums within partitions.
- Performance improvements for window functions through optimizations like push-down of predicates and better parallelization.
So in summary, SQL Server 2012 significantly expands the