LEAST
Description
The LEAST function returns the least element that is not NULL from a set of values.
It supports all PQL types (including table columns) as input. All arguments must be of the same data type except for integers and floats which can be mixed. The data type of the result is the same as the data type of the input columns or values and float if integer and float input expressions are mixed. For example, for input of type INT, LEAST will return the type INT. And if some inputs are of type INT and some other inputs are of type FLOAT, LEAST will return the type FLOAT
The LEAST function requires at least two expressions.
Unicode Support
For the STRING type, LEAST only supports the ASCII range of characters, and not the full Unicode character set.
SYNTAX
LEAST ( table.column1 , ... , table.columnN )
NULL handling
If all values are NULL, then LEAST will also return NULL.
Tips
Examples
[1] LEAST with four integer columns as arguments with some null values at different positions: | |||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||
|
[2] LEAST with two columns and a constant as arguments: | ||||||||||||||||||||||
| ||||||||||||||||||||||
|
[3] LEAST with four integer columns as arguments containing only null values: | ||||||||||||||||||||||||
| ||||||||||||||||||||||||
|
[4] LEAST with four float columns as arguments with some null values at different positions: | |||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||
|
[5] LEAST with four string columns as arguments with some null values at different positions: | |||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||
|
[6] LEAST with four date columns as arguments with some null values at different positions: | |||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||
|
[7] If the inputs contain integer and float types the result will be of type float. | ||||||||||||||||||||||
| ||||||||||||||||||||||
|