I have 4 tables for student attendance.
- Students (sid, name, regno)
- classes (classid, startdate, enddate)
- Student to Classes (sid, classid)
- class attendance (classid, sid, attendance, date)
I want to display attendance data of a class as:
<table>
<tr>
<th>RegNo</th>
<th>Name</th>
<th>Date 1</th>
<th>Date 2</th>
<th>so on</th>
</tr>
<tr>
<td>1</td>
<td>ABC</td>
<td>Present</td>
<td>Absent</td>
<td>So on</td>
</tr>
</table>
Date range is from classes table. I want to query the tables with date range as well as for all record of a class. Kindly help me with the query. Thanks in advance.