sql计算百分比

select a.creatdate,a.subcount,b.total,a.subcount*100/total from

(select creatdate,COUNT(0) subcount from test where [percent]>75 group by creatdate)a

,

(select creatdate,COUNT(0)  as total from test group by creatdate)b where a.creatdate=b.creatdate

原文地址:https://www.cnblogs.com/dashi/p/4034665.html