GREATEST
Returns the largest value in a list.
Syntax
GREATEST(<value1>, <value2>, …)
Compares several values in the same row and returns the largest. Its mirror function is LEAST, which returns the smallest. Don't confuse it with MAX: that one searches across many rows, while GREATEST looks at values side by side. Handy for putting a floor under a number: “at least”.