sum(cast req_num as float) 用发
2014-03-17 09:58
363 查看
sum(cast req_num as float) 这个用法是不对的
正确的是:
select top 3 calling,sum(case when result=200 then 1 else 0 end)/convert(float,sum(req_num)) as req_num2 from WAP_BDR010317 group by calling
calling req_num2
-------------------------------- ---------------------------
8613711012367 0.700000
8618825042842 0.750000
8613415200578 0.818182
正确的是:
select top 3 calling,sum(case when result=200 then 1 else 0 end)/convert(float,sum(req_num)) as req_num2 from WAP_BDR010317 group by calling
calling req_num2
-------------------------------- ---------------------------
8613711012367 0.700000
8618825042842 0.750000
8613415200578 0.818182
相关文章推荐
- 文章标题SELECT sum(ord.order_price) as order_total_price, count(distinct ord.user_id) as user_total_num
- SUM(CASE WHEN RECHARGE_STATUS =1 THEN 1 ELSE 0 END) as 成功数量,
- Sum Root To Leaf Num
- mysql中sum float类型使用小数点的方法
- ASP 求和(select sum(num))
- MySql 字段类型为float时,SUM汇总时出现一堆小数的问题
- C# sqlite在使用cast(sum(a) as decimal) 时认作int型的问题处理
- TypeError: 'float' object cannot be interpreted as an integer
- AS 报错 Error:(303, 27) 错误: 找不到符号 符号: 方法 sin(float) 位置: 类 FloatMath
- [LeetCode] Print All Combinations of a Number as a Sum of Candidate Numbers
- 作业五-设计一个程序计算输入的两个数的和与差,要求自定义一个函数 sum_diff(float op1, float op2, float *psum, float *pdiff),其中 op1 和 op2 是输入的两个数,*psum 和*pdiff 是计算得出的和与差.
- Struct is the same as int and float
- SQL语句中SUM的返回值变成了float类型了。
- 将整数nSum拆分成num个数的和的形式——阿里巴巴笔试题
- uva 1210 sum of CONSECUTIVE prime num 暴力or尺取
- [CrackCode] 2.4 Add two numbers and return the sum as a linked list
- 1003:Hangover-条件是程序可以持续的条件-每一次循环sum要清零-for括号后不要;-float与double-除法不要除以0
- xilinx "ERROR:EDK - intc () - Internal error: Num intr inputs 1 not the same as length of ..."解决
- AS 报错 Error:(303, 27) 错误: 找不到符号 符号: 方法 sin(float) 位置: 类 FloatMath
- python-Error Message: 'float' object cannot be interpreted as an integer