forked from docs/doc-exports
Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com> Co-authored-by: Su, Xiaomeng <suxiaomeng1@huawei.com> Co-committed-by: Su, Xiaomeng <suxiaomeng1@huawei.com>
5.2 KiB
5.2 KiB
greatest
This function is used to return the greatest value in a list of values.
Syntax
greatest(T v1, T v2, ...)
Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
v1 |
Yes |
DOUBLE, BIGINT, or DECIMAL |
The value can be a float or integer. |
v2 |
Yes |
DOUBLE, BIGINT, or DECIMAL |
The value can be a float or integer. |
Example Code
The value 4.0 is returned.
select greatest(1,2.0,3,4.0);
The value NULL is returned.
select greatest(null);
Parent topic: Mathematical Functions