아래SQL문장 출력결과 2623 Y 2019.09.25 B, Y 2623 B 2019.09.26 B, B 2623 B 2019.09.27 B, B ---- 제각 생각했던 출력결과 2623 Y 2019.09.25 B, B 2623 B 2019.09.26 B, B 2623 B 2019.09.27 B, B 이유> 일자를 DESC 후 FIRST_VALUE() 일자를 ASC 후 LAST_VALUE() 위와 같은 기준이기에 ..값은 값이 나올거라 예상했는데.. 왜 다르게 나올까요? WITH V_VB AS ( SELECT '2623' AS RSTR_CD, 'B' SIGNL_LIGHT, '20190927' AS REGI_DTIME FROM DUAL UNION ALL SELECT '2623' AS RSTR_CD, 'B' SIGNL_LIGHT, '20190926' AS REGI_DTIME FROM DUAL UNION ALL SELECT '2623' AS RSTR_CD, 'Y' SIGNL_LIGHT, '20190925' AS REGI_DTIME FROM DUAL ) SELECT VB.* , FIRST_VALUE(VB.SIGNL_LIGHT) OVER (PARTITION BY VB.RSTR_CD ORDER BY VB.REGI_DTIME DESC) AS FIST_SIGNL_LIGHT , LAST_VALUE(VB.SIGNL_LIGHT) OVER (PARTITION BY VB.RSTR_CD ORDER BY VB.REGI_DTIME ASC) AS LAST_SIGNL_LIGHT FROM V_VB VB;