我有一张缺勤表,那张表存储着缺勤人员的学生证。
从这个表中我必须找到总出席者和总缺席者,为此我刚刚加入了包含特定部分最大容量的部分表。
为此,我的查询是
select COUNT(Attendance.studentid) as Absentees
,Sections.Max-count(studentid) as Presentees
from Attendance
inner join Students
on students.StudentId=Attendance.StudentId
inner join Sections
on Sections.CourseId=students.CourseId
group by Sections.Max
它工作正常,同样我如何找到性别明智的出席者/缺席者......性别列在学生表中,任何人都可以给我一些想法,提前谢谢