Row numbers with partitions
suggest changeUses a partition criteria to group the row numbering according to it.
SELECT
ROW_NUMBER() OVER(PARTITION BY DepartmentId ORDER BY DepartmentId ASC) AS RowNumber,
DepartmentId, Fname, LName
FROM Employees
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents