I have next table:
(AUTO_INCREMENT)
|
V
survey_id | user_id| tries | results
------------|--------|---------------
1 | 10 | 1 | A
2 | 10 | 2 | B
3 | 11 | 1 | C
4 | 10 | 3 | D
5 | 11 | 2 | E
I have, for example, user_id = 10
and I want to get the value from the result
row where tries value has the max result for this user, in this case it is going to be D
result.
How could I do this query in SQL
?