homework 3 (window functions)

Fatima Zahra 1 year ago
parent a231d9c5fe commit af8e5f14b07811fabab284394d3a9aa1548a7287
1 changed files with 4 additions and 0 deletions
+4-0homework-3.sql ADDED
View File
@@ -0,0 +1,4 @@
1+-- Homework 3: rank employees by salary inside each department
2+SELECT name, department, salary,
3+ DENSE_RANK() OVER (PARTITION BY department ORDER BY salary DESC) AS pos
4+FROM employees;