I have 2 tables. Student and test. I would like to make a query which gets the student name (firstname and lastname) of the student which got the highest value in "test.test_results". I have tried 2 queries but both do not give me the output I want:
SELECT student.studentFirstName, student.studentLastName, test.test_results, FROM student INNER JOIN test ON student.studentID = test.studentID where MAX(test.test_results) ;
This Query is wrong i think and gives me an error.
SELECT student.studentFirstName, student.studentLastName, test.test_results, MAX(test.test_results) FROM student INNER JOIN test ON student.studentID = test.studentID;
This Query runs and gives me the student who got the highest result however it creates an extra column named "MAX(test.test_result)"
How can I make a query which gives me the name of the student who got the highest test_results from the table test.