'Is there a way to select the maximum value from a column in table and join with another table, some information that matches the highest value
I am working with two different tables, one contain student information like names , phones number and so an while another table contains the result of student for some courses. I want to select the maximum score from the result table and join it (match) with the name of the student that has the score from the other table that contain the student information
Solution 1:[1]
I have been working on this for like 5 days now but finally I got it.. So happy...
SELECT
result.StudentID, student.last_name, student.first_name, student.other_name, max(result.CSC331)
from result
INNER join student on result.StudentID=student.StudentID
and (student.Session = '2020/2021')
GROUP BY result.CSC331 desc
order by result.CSC331 desc
limit 1
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Mayowa Ige |
