Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumSQLwindow functions ROW_NUMBER RANKSingle-choice MCQ

Using the default window frame (ORDER BY present, no ROWS/RANGE clause), what does FIRST_VALUE vs LAST_VALUE return here?

SELECT v, FIRST_VALUE(v) OVER w AS fv, LAST_VALUE(v) OVER w AS lv FROM t WINDOW w AS (ORDER BY v); -- v: 10, 20, 30