如何将此查询转换为使用where where in条件的嵌套查询?
SELECT schedule.subcode,attendance.usn,avg(attendance.ispresent)* 100 as Attendance_Percentage 从计划JOIN出勤ON schedule.sched_id = attendance.sched_id 在哪里usn =“4jc14is013”AND subcode =“is530”;
答案 0 :(得分:0)
您可以使用HAVING
:
SELECT usn, name, AVG(ispresent) attendance FROM table
GROUP BY usn, name HAVING attendance < 0.75;