3 ms·
Itzik Ben-Gan wrote a whole book just on SQL windows functions and it's brilliant. He writes for SQL server usually, but he made this one more generic, he had t
by garyclarke27 10y ago
Itzik Ben-Gan wrote a whole book just on SQL windows functions and it's brilliant. He writes for SQL server usually, but he made this one more generic, he had to because at the time SQL server 2012 was missing much of the functionality he described, unlike Postgres or Oracle.
Postgres has incredible capability here - Window AND Frame partitions/ordering, also row based ranges or value based ranges. And as a huge bonus unique to Postgres, the wondeful - Filter by clause - so much more elegant than sub queries.
- j_s 10y agoThis one? Microsoft SQL Server 2012 High-Performance T-SQL Using Window Functions (Developer Reference) https://www.amazon.com/dp/B00JDMPHKY https://www.amazon.com/dp/B00JDMPHKY