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

posted @ 2013-04-05 16:16  顿金  阅读(199)  评论(0编辑  收藏  举报