I had also observed the change of LAST_VALUE function compared to FIRST_VALUE. Had to spend sometime before I understood the reason for this change of behavior. The result what you see is correct but difference is not well explained in above example. Reason lies in ROWS clause which is related to LAST_VALUE(). When not specified it defaults to ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW. Within this window it finds the LAST_VALUE and returns which is what you see in results above. To get t
↧