SELECT uid, # 計(jì)算均分,當(dāng)有score的時(shí)候,就返回實(shí)際的,沒有就是0 ROUND(AVG(IF(score, score, 0)), 0) avg_score, # 計(jì)算均用時(shí),使用TIMESTAMPDIFF計(jì)算時(shí)間差,分鐘為單位 ROUND(AVG(IF(score, TIMESTAMPDIFF(MINUTE, start_time, submit_time), duration)), 1) avg_time_took FROM exam_record c JOIN user_info a USING(uid) JOIN examinat...