如何将此查询转换为使用where in condition的嵌套查询?
SELECT schedule.subcode,attendance.usn,avg(attendance.ispresent)*100作为Attendance_Percentageschedule.sched_id=attend .sched_idWHERE usn="4jc14is013" AND subcode="is530";
您可以使用HAVING
:
SELECT usn, name, AVG(ispresent) attendance FROM table
GROUP BY usn, name HAVING attendance < 0.75;