需要帮助获取具有内部联接的成绩的最大值。
代码:
<extension point="org.eclipse.ui.services">
<sourceProvider provider="com.plugin.YourClass"></sourceProvider>
</extension>
只需要获得Grade的最大值,这样输出就会缩短到1行。
答案 0 :(得分:0)
你应该使用group by和max like:
SELECT StudFirstName, StudLastName, sc.ClassID, sub.SubjectID, sub.CategoryID, MAX(Grade)
FROM SS_Students as st INNER JOIN SS_Student_Schedules as ss
ON st.StudentID = ss.StudentID
INNER JOIN SS_Classes as sc
ON ss.ClassID = sc.ClassID
INNER JOIN SS_Subjects as sub
ON sc.SubjectID = sub.SubjectID
GROUP BY StudFirstName, StudLastName, sc.ClassID, sub.SubjectID, sub.CategoryID
这将为您提供每个学生的学生列表和最高分。