sql语句:去掉最大值,去掉最小值,算平均值SELECT AVG(Scores.Score)FROM ScoresWHERE ( ( (Scores.[ID]) = @id)AND (Score < (SELECT MAX(Score) From Scores WHERE Scores.[ID] = @id) )AND (Score > (SELECT MIN(Score) From Scores WHERE Scores.[I
来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/23 11:15:51
sql语句:去掉最大值,去掉最小值,算平均值SELECT AVG(Scores.Score)FROM ScoresWHERE ( ( (Scores.[ID]) = @id)AND (Score < (SELECT MAX(Score) From Scores WHERE Scores.[ID] = @id) )AND (Score > (SELECT MIN(Score) From Scores WHERE Scores.[I
sql语句:去掉最大值,去掉最小值,算平均值
SELECT AVG(Scores.Score)
FROM Scores
WHERE ( ( (Scores.[ID]) = @id)
AND (Score < (SELECT MAX(Score) From Scores WHERE Scores.[ID] = @id) )
AND (Score > (SELECT MIN(Score) From Scores WHERE Scores.[ID] = @id) ) )
如果出现相同的分数则计算结果会不对.会少一些分数
我并不是想去除重复分数,而是比如
100 20 30 40 40 60 100
我希望:AVG(30+40+40+60+100)
做高分有重复的话,只删除一个
sql语句:去掉最大值,去掉最小值,算平均值SELECT AVG(Scores.Score)FROM ScoresWHERE ( ( (Scores.[ID]) = @id)AND (Score < (SELECT MAX(Score) From Scores WHERE Scores.[ID] = @id) )AND (Score > (SELECT MIN(Score) From Scores WHERE Scores.[I
SELECT (sum(Scores.Score)-max(Scores.Score)-min(Scores.Score))/(count(*)-2)
FROM Scores
WHERE (Scores.[ID]) = @id group by (Scores.[ID])
Oracle下可以的,你用的是什么数据库.