Updated on 2026-11-06 GMT+08:00

least

The least function is used to return the minimum value from a list.

Syntax

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

Parameters

Parameter

Mandatory

Type

Description

v1

Yes

DOUBLE, BIGINT, or DECIMAL

The format of parameter v1 includes floating-point format, integer format, and DECIMAL format.

v2

Yes

DOUBLE, BIGINT, or DECIMAL

The format of parameter v2 includes floating-point format, integer format, and DECIMAL format.

Return Values

Returns a value of type DOUBLE.

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

Example Code

Returns 1.0.

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

Returns NULL.

select least(null,null);