oracle 분석함수 windowing 절 기본값 0 1 2,182

by 오라클 [2015.08.16 21:18:38]


select s.grade
      ,max(s.height)over(partition by s.grade order by s.height asc
                         rows between unbounded preceding and unbounded following) as 키
      ,last_value(s.name)over(partition by s.grade
                              order by s.height desc nulls last
                              rows between unbounded preceding and unbounded following) as 이름
from student s;

 

제가 위에 같은 꿔리를 짰는데요, 빨간 게 있고 없고에 따라서 결과가 다르더라고요. 그런데 제가 뇌자극 오라클 책에서 보길

"윈도우 절을 생략할 땐 Between unbounded preceding and unbounded following이 적용된다"라고 써 있는 걸 봤는데, 이거는 잘 못된 건가요?

by 마농 [2015.08.17 08:49:50]

윈도우 구문 생략시 기본 적용되는 것은
Range Between Unbounded Preceding and Current Row 입니다.

댓글등록
SQL문을 포맷에 맞게(깔끔하게) 등록하려면 code() 버튼을 클릭하여 작성 하시면 됩니다.
로그인 사용자만 댓글을 작성 할 수 있습니다. 로그인, 회원가입