homework 3 (window functions)

Lena Fischer 11 months ago
parent 780614e9a3 commit 2aed14194dc698667cea23e20d29f3a3f32792f0
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;