Pivot Attendance by Weekday
Medium
Pivot & Unpivot
Return one row per student with the columns Mon and Tue holding their present flag (1 or 0) for each weekday. Order by student.
Table schema
Attendance(student VARCHAR(20), weekday VARCHAR(3), present INT)Sample data
student | weekday | present
Amy | Mon | 1
Amy | Tue | 0
Ben | Mon | 1
Ben | Tue | 1
Discussion
No discussions yet.
Shalyam Support
Hi! Ask us anything — we'll reply on WhatsApp or Telegram within 24 hours.