September 2002
Intermediate to advanced
1024 pages
30h 52m
English
GREATEST
GREATEST takes one or more strings as input, and returns the string that would come last (i.e., that is the greatest) if the inputs were to be sorted in ascending order. The ordering of the strings is based on character code in the database character set. GREATEST has the following specification:
FUNCTION GREATEST (string1IN VARCHAR2,string2IN VARCHAR2,...) RETURN VARCHAR2
Following is an example:
BEGINDBMS_OUTPUT.PUT_LINE(GREATEST('Jonathan','Steven','Bill'));END;Steven
Also see the LEAST function, which is the opposite of GREATEST.
Read now
Unlock full access