last, last_ value
On this page
Returns the last input value.
Syntax
last( <expr> )
last_value( <expr> )last returns the last value, including NULL. last_value returns the last non-NULL value.
Examples
VALUES ('a'), ('b'), (NULL)
AGGREGATE last($0), last_value($0);