日期:2014-05-17  浏览次数:20680 次

数据处理问题
在一个表(temp)中有时间(recorddate)、产品(products)、等级(grade)

其中等级有a\b\c三种。

      我该怎么用sql语句求a级率阿??
谢谢!
        a级的产品量/全部产品量      


------解决方案--------------------
select (select count(*) from temp t where t.grade = 'a ') /
(select count(*) from temp) as result
from dual;
------解决方案--------------------
RATIO_TO_REPORT

http://community.csdn.net/Expert/topic/5702/5702212.xml?temp=.3837702