I searched and found many results using "Grep highest value of a row in MySQL" but I don't understand the results.
I have a row which primary key value is 4 and there are another 8 values.
Those are 45 78 89 54 98 14 19 70
. I want to select the highest value, ie 98
from this row. How do I do this ?
My database table name is class6A
Best Answer
Use the GREATEST() function on all the columns
If any of the columns are NULL, then make the NULL the value 0
GIVE IT A TRY !!!
In the future, you may add another subject to or remove a subject from the student record.
Here is another method using Dynamic SQL that figures out the subjects present in the table