I need to get maximum value of certain number of columns (for each row). Is this possible to do in MySQL?
For example:SELECT MAX(column1, column2, column3)
.
I'm not looking for MAX function that aggregates values of a given column. I need to aggregate values of different columns for each row.
You need the GREATEST
function
SELECT GREATEST(column1, column2, column3) AS X
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With