doc-exports/docs/dli/sqlreference/dli_spark_least.html
Su, Xiaomeng 76a5b1ee83 dli_sqlreference_20240227
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>
2024-03-27 22:02:33 +00:00

5.3 KiB

least

This function is used to return the smallest value in a list of values.

Syntax

least(T v1, T v2, ...)

Parameters

Table 1 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.

Return Values

The return value is of the DOUBLE type.

  • If the value of v1 or v2 is of the STRING type, an error is reported.
  • If the values of all parameters are NULL, NULL is returned.

Example Code

The value 1.0 is returned.

select least(1,2.0,3,4.0);

The value NULL is returned.

select least(null);