- Notifications
You must be signed in to change notification settings - Fork689
OVER
Mathias Wulff edited this pageDec 15, 2025 ·3 revisions
TheOVER clause defines a window or user-specified set of rows within a query result set. A window function then computes a value for each row in the window.
Syntax:
function_name() OVER ( [ PARTITION BY column1, ... ] [ORDER BY column2, ... ] )AlaSQL supports:
ROW_NUMBER()
Returns the sequential number of a row within a partition of a result set, starting at 1 for the first row in each partition.
SELECT ROW_NUMBER() OVER (PARTITION BY DepartmentORDER BY SalaryDESC)AS RowNum, Name, Department, SalaryFROM Employees
See also:PARTITION
© 2014-2026,Andrey Gershun &Mathias Rangel Wulff
Please help improve the documentation by opening a PR on thewiki repo