Aggregation functions
ANY_VALUE
Reference material for ANY_VALUE
Returns a single arbitrary value from the specified column.
Alias: ANY
Syntax
Parameters
Parameter | Description | Supported input types |
---|---|---|
<expression> | Any expression | Any |
This function ignores NULL
inputs. It returns NULL
only when all inputs are NULL
or there are no inputs.
Return Type
Same as input type
Examples
Example
Returns
Any value of the nickname
column, excluding NULL
. The first time the query below runs, the nickname kennethpark
might be returned. The second time the query runs, sabrina21
or any other value, such as ruthgill
or steven70
, might be returned, but NULL
will never be returned while non-NULL
options exist.
Example
Returns
NULL
as no non-NULL
values are available.