Assigns a unique sequential integer to each row within a partition.
Syntax
ROW_NUMBER() OVER (w)Example
Enter values below to update the example in real time.
department_id→employee_id→hire_date→hire_seq→employees→-- 부서별 입사 순번
SELECT department_id, employee_id, hire_date,
ROW_NUMBER() OVER (PARTITION BY department_id ORDER BY hire_date) AS hire_seq
FROM employees;