-
Assign row numbers to employees
-
Rank employees by salary
-
Dense rank employees by salary
-
Find top 3 salaries
-
Find top 3 salaries in each department
-
Find highest salary in each department
-
Calculate running salary total
-
Calculate cumulative sales
-
Get previous salary value
-
Get next salary value
-
Compare current and previous month sales
-
Find salary difference from previous employee
-
Find first salary in each department
-
Find last salary in each department
-
Find average salary by department without grouping
-
Find percent contribution of salary
-
Find duplicate rows using row_number
-
Delete duplicate rows
Use above query in CTE and delete where rn > 1.
-
Find latest order per customer
-
Find first order per customer