sql计算百分比
2013-04-05 16:16
281 查看
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
(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计算出百分比
- sql中如何计算百分比
- SQL语句中计算百分比
- sql计算出百分比
- sql计算出百分比
- sql计算百分比
- SQL 计算百分比,避免除零错误
- sql中计算百分比
- SQL计算百分比
- sql中如何计算百分比 ,并保留两位小数
- MS SQL Server 计算列用到自定义函数 创建索引
- SQL拼接字段,算数计算
- oracle----sql----查询---为例---计算
- sql语句实现同一时间范围内并发数统计计算
- 集算器如何优化SQL计算(4)字串与日期
- mysql的sql语句中直接计算时间 查询昨天 一周前 一月前 一年前的数据的方法
- T-SQL 计算固定资产折旧(直线法)
- sql 计算两经纬度间的距离
- SQL 函数计算
- 利用SQL语句计算库存