partitionBy()
: Groups rows into partitions (similar to GROUP BY
).orderBy()
: Orders rows within each partition.rowsBetween()
or rangeBetween()
: Defines the window frame (e.g., current row, preceding rows, following rows).row_number()
, rank()
, dense_rank()
.lead()
, lag()
.sum()
, avg()
, min()
, max()
.row_number()
: Assigns a unique sequential number to each row within a partition.rank()
: Assigns a rank to each row, with gaps for ties.dense_rank()
: Assigns a rank to each row, without gaps for ties.lead()
: Accesses the value of a column in the next row.lag()
: Accesses the value of a column in the previous row.sum()
, avg()
, min()
, max()
: Perform aggregations over a window of rows.row_number()
for Rankingrank()
and dense_rank()
lead()
and lag()
OVER
clauses.