#Window functions
9 messages · Page 1 of 1 (latest)
Not very well, but window functions allow to define a set of rows (often but not exclusively) like N rows above or below the current row, so that you can then do a group by on just the rows in that sliding window
So if you want to say “for every day of sales, show the sum of the previous n days of sales”
Window functions are for performing aggregations across multiple rows. Unlike a GROUP BY they return a result for every row. Some common applications are cumulative sums or a moving average. In my experience they're more of an advance analysis technique and I rarely encounter them in app development.
I would not recommend the Postgres Docs for learning it's not aimed at beginners, instead check out this website: https://www.postgresqltutorial.com/postgresql-window-function/
I'm not a beginner to programming but yes, I'm beginner to Relational Databases. Thanks for the website.
Then you know your way around some technical docs! But yeah I still prefer the tutorial site for its examples and covering the typical use case.
But I heard that tutorials are not good. (The famous phrase -> "Tutorial hell").
Really? I haven't heard that before. But I use it more as a reference, it just has "tutorial" in the name.