私は欠席者用のテーブルを持っており、そのテーブルには欠席した人の学生IDが保存されています。
このテーブルから、総プレゼンティと総欠席者を見つける必要がありました。このために、特定のセクションの最大容量を含むセクションテーブルに参加しました。
このための私のクエリは
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
うまく機能しているのと同じように、性別ごとの発表者/欠席者を見つける方法......性別の列が学生の表にあります。誰かが私にアイデアを教えてくれますか、事前に感謝します