Function first_value

Source
fn first_value(state: &mut FirstValueState, input: Option<ScalarRefImpl<'_>>)
Expand description

Note that different from min and max, first_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 first_value(v1 order by ts) from t;
----
NULL

statement ok
drop table t;