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

你可能感兴趣的:(sql计算)