LEAST
This function returns the smallest of the provided values.
Syntax
Arguments
VALUE
VALUE
Type: double
, bigint
, string
, timestamp
, date
, array
A value of any of the above types, provided that all values are of the same type.
Returns
Type: same as input
The smallest of the provided values.
When the input values are arrays, the smallest element between all the arrays is returned.
If any of the input values are null
, the result is null
as well.
Examples
Transformation job example
SQL
Query result
least_example1 | least_example2 | least_example3 |
---|---|---|
3.4 | a | null |
Example with arrays
SQL
Query result
least_example1 | least_example2 | least_example3 |
---|---|---|
0.2 | 0.2 | null |
Note that least_example3
evaluates to null
since the array containing only null
is considered a null value.
For arrays that contain both null and non-null values, SQLake ignores those null values when working with the array; as such, least_example2
evaluates to 0.2
instead of null
.
Last updated