Back to Developer Roadmap

Aggregate and Window Functions

src/data/roadmaps/postgresql-dba/content/aggregate-and-window-functions@iQqEC1CnVAoM7x455jO_S.md

4.0898 B
Original Source

Aggregate and Window Functions

Aggregate functions in PostgreSQL perform calculations on a set of rows and return a single value, such as SUM(), AVG(), COUNT(), MAX(), and MIN(). Window functions, on the other hand, calculate values across a set of table rows related to the current row while preserving the row structure. Common window functions include ROW_NUMBER(), RANK(), DENSE_RANK(), NTILE(), LAG(), and LEAD(). These functions are crucial for data analysis, enabling complex queries and insights by summarizing and comparing data effectively.

Learn more from the following resources: