mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-30 03:22:14 +00:00
764 B
764 B
slug | sidebar_position |
---|---|
/en/sql-reference/aggregate-functions/reference/anylast | 104 |
anyLast
Selects the last value encountered. The result is just as indeterminate as for the any function.
Syntax
anyLast(column)
Parameters
column
: The column name.
Returned value
- The last value encountered.
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) FROM any_last_nulls;
┌─anyLast(city)─┐
│ Valencia │
└───────────────┘