mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-18 04:12:19 +00:00
a278d13043
remove redundant 's'
1.1 KiB
1.1 KiB
slug | sidebar_position |
---|---|
/en/sql-reference/aggregate-functions/reference/first_value | 7 |
first_value
Selects the first encountered value, similar to any
, but could accept NULL.
examples
insert into test_data (a,b) values (1,null), (2,3), (4, 5), (6,null)
example1
The NULL value is ignored at default.
select first_value(b) from test_data
┌─first_value_ignore_nulls(b)─┐
│ 3 │
└─────────────────────────────┘
example2
The NULL value is ignored.
select first_value(b) ignore nulls from test_data
┌─first_value_ignore_nulls(b)─┐
│ 3 │
└─────────────────────────────┘
example3
The NULL value is accepted.
select first_value(b) respect nulls from test_data
┌─first_value_respect_nulls(b)─┐
│ ᴺᵁᴸᴸ │
└──────────────────────────────┘