Function last_value

Source
fn last_value<T>(_: Option<T>, input: Option<T>) -> Option<T>
Expand description

Note that different from min and max, last_value doesn’t ignore NULL values.

statement ok
create table t(v1 int, ts int);

statement ok
insert into t values (null, 1), (2, 2), (null, 3);

query I
select last_value(v1 order by ts) from t;
----
NULL

statement ok
drop table t;