select avg() from ( select max(col) ma,min(col) mi from tt ) a ,tt where t.col <> a.ma and t.col <>a.mi
with A as ( select 10 as times from dual union all select 11 as times from dual union all select 12 as times from dual union all select 10 as times from dual union all select 11 as times from dual union all select 13 as times from dual) select avg(times) from a where times not in ( select min(times) from a union all select max(times) from a )
select avg(a) from{select max(a)ama,min(a)ami from t}t1,t where t.a<ama and t.a>ami;
select (sum(column)-max(column)-min(column))/(count(column)-2) f from s_biz_activity 这样试试
select avg(x) from t,(select max(x) mx,min(x) mn) t1 where t.x>t1.mn and x<t1.mx
from
(
select max(col) ma,min(col) mi from tt
) a
,tt
where t.col <> a.ma
and t.col <>a.mi
union all
select 11 as times from dual
union all
select 12 as times from dual
union all
select 10 as times from dual
union all
select 11 as times from dual
union all
select 13 as times from dual)
select avg(times) from a where times not in (
select min(times) from a
union all
select max(times) from a )
where t.a<ama and t.a>ami;
这样试试