+ -
当前位置:首页 → 问答吧 → 去除最低分最高分,其他取平均分

去除最低分最高分,其他取平均分

时间:2010-11-17

来源:互联网

各位这方面的高手们,我想实现去除最低分和最高分,其他取平均分的功能,该如何做呢?我先上图:

我只想得到最后那个去掉最低最高的平均分。
以下是我查出上图记录的SQL语句:
select t.*, t.rowid from pingshenxiangmudefen t where t.shenbaorenbianhao='330323197206250048' and t.pingshenxiangmubianhao='4'

作者: iceforest   发布时间: 2010-11-17

select (sum(defen)-max(defen)-min(defen))/(count(id)-2) from pingshenxiangmudefen where shenbaorenbianhao='330323197206250048' and pingshenxiangmubianhao='4'

作者: cs99619   发布时间: 2010-11-17