반응형
select
employee_id
,salary
,sum(salary) over(partition by department_id order by employee_id
rows between unbounded preceding and unbounded following) w1
,sum(salary) over(partition by department_id order by employee_id
rows between unbounded preceding and current row) w1
,sum(salary) over(partition by department_id order by employee_id
rows between current row and unbounded following) w1
from employees
where department_id = 60;
employee_id
,salary
,sum(salary) over(partition by department_id order by employee_id
rows between unbounded preceding and unbounded following) w1
,sum(salary) over(partition by department_id order by employee_id
rows between unbounded preceding and current row) w1
,sum(salary) over(partition by department_id order by employee_id
rows between current row and unbounded following) w1
from employees
where department_id = 60;
반응형
'Oracle' 카테고리의 다른 글
[윈도우 함수] ratio_to_report로 특정 비율 구하기 (0) | 2015.07.29 |
---|---|
[윈도우 함수] LAG 바로 이전 쿼리의 특정 열의 값을 가져옴 (0) | 2015.07.29 |
[ntile]레코드를 일정 비율로 분할해준다. (0) | 2015.07.29 |
컬럼당 최대값 최소값 구하기 keep(dense_rank first order by salary desc) (0) | 2015.07.29 |
순위함수 (0) | 2015.07.29 |
댓글