GREATEST: Returning the Largest Value

How to:

With two or more arguments, GREATEST returns the largest (maximum-valued) argument. The arguments are compared using the following rules:

Syntax: How to Return the Largest Value

GREATEST(value1, value2, ... , valuen)

where:

value1, value2, ... , valuen

Numeric or alphanumeric

Are the values to be compared.

Example: Returning the Largest Value

GREATEST returns the largest argument.

GREATEST(X,Y,Z)

For X=2, Y=0, and Z=-1, the result is 2.

For X='B', Y='A', and Z='C', the result is 'C'.

WebFOCUS

Feedback