不需要子查询的方法~ 未完成的情况可以用IF来选择 IF(score, score, 0) # 如果没有score就设为0 IF(submit_time, TIMESTAMPDIFF(minute, start_time, submit_time), duration) # 如果没有submit_time就设为duration=60分钟 最终代码 SELECT uid, round(SUM(IF(score, score, 0)) / COUNT(uid), 0) avg_score, round(SUM(IF(submit_time, TIMESTAMPDI...