I have a table similar to this (3 rows, 4 columns: id, name, gradeA, gradeB):
id name gradeA gradeB
------------------------------
1 David 59 78
2 Anna 66 92
3 David 22 89
I'm looking for a query that will give me 1 numeric property for the highest grade by in the whole table by condition. for example:
What is the highest grade for any student named David?
The answer should be { maxGrade: 89 }
Note: grades are stored as varchar values and should be cast to numeric values for comparison