Find max data on sql server
I have a table like this and find the max elevation
STUDENT
|id | name | mark |
|1 | john | 56 |
|2 | sara | 81 |
|3 | mattew| 65 |
suppose it will be
|id | name | mark |
|2 | sara | 81 |
but i get this kind of output
|id | name | mark |
|1 | john | 81 |
I am writing this in sql
SELECT id,name,MAX(mark)
FROM student;
WHERE name IN
(SELECT name
FROM student);
how can i fix sql?
+3
source to share