ClickHouse/docs/en/sql-reference/aggregate-functions/reference/any_respect_nulls.md
2024-05-04 16:20:58 +02:00

1.0 KiB

slug sidebar_position
/en/sql-reference/aggregate-functions/reference/any_respect_nulls 103

any_respect_nulls

Selects the first encountered value of a column, irregardless of whether it is a NULL value or not.

Alias: any_value_respect_nulls, first_value_repect_nulls.

Syntax

any_respect_nulls(column)

Parameters

  • column: The column name.

Returned value

  • The last value encountered, irregardless of whether it is a NULL value or not.

Example

Query:

CREATE TABLE any_nulls (city Nullable(String)) ENGINE=Log;

INSERT INTO any_nulls (city) VALUES (NULL), ('Amsterdam'), ('New York'), ('Tokyo'), ('Valencia'), (NULL);

SELECT any(city), any_respect_nulls(city) FROM any_nulls;
┌─any(city)─┬─any_respect_nulls(city)─┐
│ Amsterdam │ ᴺᵁᴸᴸ                    │
└───────────┴─────────────────────────┘

See Also