1 year ago
7 lines225 B
SELECT name, department, salary, | |
RANK() OVER (PARTITION BY department ORDER BY salary DESC) AS rank | |
FROM employees; | |
| |
SELECT ordered_at, total, | |
SUM(total) OVER (ORDER BY ordered_at) AS running_total | |
FROM orders; |