If we would consider window functions as an extension to vanilla SQL, what is their advantage over it?
Can you perform queries and things that wouldn't be possible with 'plain' SQL?
If we would consider window functions as an extension to vanilla SQL, what is their advantage over it?
Can you perform queries and things that wouldn't be possible with 'plain' SQL?
The simple answer is "yes", you can do things that wouldn't be possible otherwise -- at least not in a single query.
A simple example is row_number()
, which you cannot replicate (in a single select) on a table that has no unique keys.