------解决方案-------------------- select case when t.num <> 0 then avg(t.num) end from table t
------解决方案-------------------- 用函数nvl 欢迎加入oracle qq群9701750
------解决方案-------------------- 直接用条件把等于0的过滤掉然后用AVG函数不就可以了 select avg(col) from table where col<> 0
------解决方案--------------------
------解决方案--------------------
------解决方案-------------------- 用decode函数处理下再avg。 with t as ( select 20 id from dual union all select 30 from dual union all select 0 from dual union all select 40 from dual union all select 110 from dual union all select 0 from dual ) select avg(decode(id,0,null,id)) from t;