SQL Function Reference

GREATEST
Returns the maximum value from the list
MySQL
GREATEST(num [,num])
Examples
MySQL
SELECT GREATEST(1, 2, -1);