mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-02 20:42:04 +00:00
967 B
967 B
slug | sidebar_position |
---|---|
/en/sql-reference/aggregate-functions/reference/anylast_respect_nulls | 106 |
anyLast_respect_nulls
Selects the last value encountered, irregardless of whether it is NULL
or not.
Syntax
anyLast_respect_nulls(column)
Parameters
column
: The column name.
Returned value
- The last value encountered, irregardless of whether it is
NULL
or not.
Example
Query:
CREATE TABLE any_last_nulls (city Nullable(String)) ENGINE=Log;
INSERT INTO any_last_nulls (city) VALUES ('Amsterdam'),(NULL),('New York'),('Tokyo'),('Valencia'),(NULL);
SELECT anyLast(city), anyLast_respect_nulls(city) FROM any_last_nulls;
┌─anyLast(city)─┬─anyLast_respect_nulls(city)─┐
│ Valencia │ ᴺᵁᴸᴸ │
└───────────────┴─────────────────────────────┘