Notice
Recent Posts
Recent Comments
목록lag (1)
송민준의 개발노트
Oracle 행 함수
쿼리를 다루다보면 특정 행에 대해 다뤄야 할 때가 있다. 종류로는 1. FIRST_VALUE 2. LAST_VALUE 3. LAG 4. LEAD 위 4가지가 있다. 1. FIRST_VALUE : 파티션에서 가장 처음에 나오는 값을 구한다.(그룹함수 MIN과 같은 결과를 구할 수 있음) select deptno, sal, first_value(sal) over () as A, first_value(sal) over (partition by DEPTNO) as B, first_value(sal) over (partition by DEPTNO order by sal) as C, first_value(sal) over (partition by DEPTNO order by sal desc rows unbounde..
DB/쿼리
2020. 8. 9. 20:52