我有4個表使用組由和爲了通過在同一時間
Class(ID,Name)
Month(ID,Name)
Student(ID,Name)
Examination(ID,Student,Class,Month,TotalMarks,ObtainedMarks)
student,class,month
已採取如Examination
表的引用的列。
我想從Examination
表order by ObtanedMarks and Group by Class
我用下面的SQL查詢
SELECT Months.Name, Class.Name AS Classname, Students.Name AS Studentname, Examination.*
FROM Class INNER JOIN
Examination ON Class.ID = Examination.Class INNER JOIN
Months ON Examination.Month = Months.ID INNER JOIN
Students ON Examination.Student = Students.ID
order by Obtained desc Group by Class.Name
選擇記錄,但查詢是不是爲我工作。
** **什麼是不工作? – Kermit
你在使用什麼SQL引擎? – cubetwo1729
您正在使用哪個數據庫服務器以及您看到了哪些錯誤消息? – Martin