← Quiz: Window Frames: all 10 questions
Quiz: Window Frames · Question 4 of 10
Why does LASTVALUE(x) OVER (ORDER BY d) often return just the current row's x?
Why does LAST_VALUE(x) OVER (ORDER BY d) often return just the current row's x?
- A.The default frame ends at the current row, so the current row is the last row in its frame
- B.LAST_VALUE ignores ORDER BY
- C.LAST_VALUE only works with PARTITION BY
- D.It is a bug in most databases
Answer & explanation
Correct answer: The default frame ends at the current row, so the current row is the last row in its frame
Extend the frame to UNBOUNDED FOLLOWING to see the real last value.
Can you get the rest right without peeking?
Take the timed Quiz: Window Frames quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →