-
Notifications
You must be signed in to change notification settings - Fork 689
OVER
Mathias Wulff edited this page Dec 15, 2025
·
3 revisions
The OVER 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 Department ORDER BY Salary DESC) AS RowNum,
Name,
Department,
Salary
FROM EmployeesSee also: PARTITION
© 2014-2026, Andrey Gershun & Mathias Rangel Wulff
Please help improve the documentation by opening a PR on the wiki repo