Try OpenEdge Now
skip to main content
SQL Reference
SQL Reference : OpenEdge SQL Functions : GREATEST
 

GREATEST

Returns the greatest value among the values of the given expressions.

Syntax

GREATEST ( expression , expression... )

Notes

*The first argument to the function can be of any type. However, 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 evaluate to NULL, the result is NULL.
*When the data type of an expressionis either CHARACTER(length) or VARCHAR(length), the expression can contain multi‑byte characters. The sort weight for each character is determined by the collation table in the database.

Example

This example illustrates the GREATEST function:
SELECT cust_no, last_name,
    GREATEST (ADD_MONTHS (start_date, 10), SYSDATE)
    FROM customer ;

Compatibility

Progress extension