The Oracle and PL/SQL GREATEST function returns the greatest of the list of one or more expressions.
GREATEST(expr1, expr2, ...)
Oracle uses the first expr to determine the return type
Example 1:
SELECT GREATEST(1,3,6,89,56,3) FROM DUAL;
returns:
89
Example 2:
SELECT GREATEST('red','yellow','blue') FROM DUAL;
returns:
yellow