I am trying to generate attendance of each student on a monthly basis. My approach is this way.. May be wrong but I am trying this way. I have an attendance table which has fields like branch, semester, section, and the attendance_status(0 or 1) field. this is recorded on a daily basis. The next table keeps a count of total number of classes conducted till date. This is to calculate the attendance percentage of each student.
What I want is to generate a table which contains student id, total number of classes attended till date by student and the total number of classes conducted till date.
I tried using distinct on student id which returns me student id without duplicates but i am not understanding how to generate the total count of classes attended by student
I have tried the following query.
select distinct a.student_id, b.totalclasses_count from bkec_attendance a,total_classes b where a.attendance_status = 1
With the above query I am able to achieve the student_id without duplicates and the total number of classes till date. I am not understanding how to get the count of classes present for each student.