APPX Software Library

Chapter 4: SQL Language Elements

4.9.2.33 GREATEST function (extension)

Syntax

GREATEST ( expression, expression, ... )

Description

The scalar function GREATEST returns the greatest value among the values of the given expressions.

Example

SELECT  cust_no, name,
     GREATEST (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.