You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
select*from emp where extract(YEAR from hiredate) =2014;
select*from emp where year(hiredate) =2014;
분석 함수
select ename, sal
, rank() over(order by sal desc) as'급여 순위'
, dense_rank() over(order by sal desc) as'순위가 같으면'
, ntile(5) over(order by sal desc, hiredate) as'그룹 묶기'
, row_number() over(order by sal desc, hiredate) as'sequence number'
, cume_dist() over(order by sal desc)*100as'전체 백분율'
, first_value(sal) over(order by sal desc)
, last_value(sal) over(order by sal desc)
from emp;
누적 함수
N-1의 sal만 누적하기
select ename, sal, sum(sal) over(order by sal rows 1 preceding)
from emp;
N+1 sal 누적하기
select ename, sal, sum(sal) over(order by sal rows unbounded preceding)
from emp;
N-1, N+1 sal 누적하기
select ename, sal, sum(sal) over(order by sal rows
between 1 preceding and1 following)
from emp;
자기부터 뒤에있는 것, 앞에있는 것 누적값 = 전체 합계
select ename, sal, sum(sal) over(order by sal rows
between unbounded preceding and unbounded following)
from emp;