oracle+如何新建账号密码oracle数据库显示两个字段相除的结果分析

SELECT SUM(a.pf_value) totalRating ,COUNT(zy_id) countRating from mic_td_user_pf a  

WHERE a.zy_id=199 AND a.pf_type=2

显示结果为 

totalRating countRating 

26       7

SELECT b.countRating ,b.totalRating/b.countRating avgRating FROM (SELECT SUM(a.pf_value) totalRating ,COUNT(zy_id) countRating from mic_td_user_pf a  

WHERE a.zy_id=199 AND a.pf_type=2) b 

countRating avgRating 

7          3.71428571428571

保留4位小数

SELECT b.countRating ,round(b.totalRating/b.countRating,4) avgRating  

FROM (SELECT SUM(a.pf_value) totalRating ,COUNT(zy_id) countRating  

from mic_td_user_pf a  WHERE a.zy_id=199 AND a.pf_type=2 AND a.del_mark = 0) b ;

countRating avgRating 

7     &oracle账号nbsp;    3.7143

此条目发表在oracle metalink账号分类目录,贴了标签。将固定链接加入收藏夹。