What is the window function?

Sql, Functions

The window function is an SQL function where the input values are taken from a window of one or more rows in the results set of a SELECT statement.

Window functions basically performs aggregation/analytical calculations over a window within the table defined using PARTITION BY clause, then applying sorting defined by ORDER BY and an optional RANGE defined using ROWS/RANGE clause.

The main functions in this category are ROW_NUMBER, DENSE_RANK, RANK, NTILE,PERCENTILE_CONT, etc