APPX Software Library

Chapter 4: SQL Language Elements

4.9.2.41 LEAST function (extension)

Syntax

LEAST ( expression, expression, ... )

Description

The scalar function LEAST returns the lowest value among the values of the given expressions.

Example

SELECT cust_no, name,
     LEAST (ADD_MONTHS (start_date, 10), SYSDATE)
     FROM  customer ;

Notes

  • The first argument to the function can be of any type. The types of the subsequent arguments must be compatible with that of the first argument.
  • The type of the result is the same as that of the first argument.
  • If any of the argument expressions evaluates to null, the result is null.