Guest User

Untitled

a guest
Mar 17th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. SELECT student_id,
  2. COUNT(attendance)
  3. FROM student_attendance
  4. WHERE attendance = 'ABSENT'
  5. GROUP BY student_id
  6. HAVING COUNT(attendance) = (SELECT max_allowed
  7. FROM configurations);
  8.  
  9. SELECT student_id,
  10. COUNT(attendance)
  11. FROM student_attendance,
  12. configurations c
  13. WHERE attendance = 'ABSENT'
  14. GROUP BY student_id
  15. HAVING COUNT(attendance) = c.max_allowed;
Add Comment
Please, Sign In to add comment