我希望将此查询限制为仅计算平均值"持续时间" 最后10 "问题"由#34;学生回答。
fibo
即。对于给定的学生,请提取已回答的问题列表以及该问题的最后10次尝试所花费的平均时间......
SELECT question, AVG(duration) AS timeTaken
FROM t_answer
WHERE student=2
GROUP BY question
样本表数据......
+----------+-----------+
| question | timeTaken |
+----------+-----------+
| 2 | 3956 |
+----------+-----------+
| 5 | 11102 |
+----------+-----------+
| 9 | 14527 |
+----------+-----------+