日期:2014-05-16 浏览次数:22501 次
select count(case when value=0 then 1 end)/count(case when value>0 then 1 end) from tb
------解决方案--------------------
select sum(if(value>0,1,0))/count(*)
from tt
------解决方案--------------------
select (select count(*) from table1 where value>0)/(select count(*) from table1);
------解决方案--------------------