I need to get the biggest value from two fields:
SELECT MAX(field1), MAX(field2)
Now, how can I get biggest value from these two?
In case you're selecting the GREATEST() for each row
SELECT GREATEST(field1, field2)
It will return NULL if one of the fields is NULL. You could use IFNULL to solve this
SELECT GREATEST(IFNULL(field1, 0), IFNULL(field2, 0))