GREATEST returns the largest expression in a list of expressions. All expressions after the first are implicitly converted to the data type of the first expression before the comparison. Text expressions are compared character by character.
To retrieve the smallest expression in a list of expressions, use
The data type of the first expression
GREATEST(expr [, expr ]...)
expr can be any expression.
GREATEST('Harry','Harriot','Harold') returns the value
GREATEST(7, 19, 3) returns the value