想通过SQL语句实现如下结果,
数值区间 [-30, -25) [-25, -20) [-20, -15) [-15, -10) [-10, -5)
求和数值 77.48777008 376.756355286 453.50503993 543.089648724 127.003311157假设数据表Table如下
A B
-29 15.2323754
-23 1.2443533
-27 15.234324
-7 10.876234
-14 5.22836734
-21 115.2323124
-5 152.212334
.......请大侠帮忙指点下如何写出sql语句实现按照A的数据区间分组统计求和?谢谢OracleSQLC#
数值区间 [-30, -25) [-25, -20) [-20, -15) [-15, -10) [-10, -5)
求和数值 77.48777008 376.756355286 453.50503993 543.089648724 127.003311157假设数据表Table如下
A B
-29 15.2323754
-23 1.2443533
-27 15.234324
-7 10.876234
-14 5.22836734
-21 115.2323124
-5 152.212334
.......请大侠帮忙指点下如何写出sql语句实现按照A的数据区间分组统计求和?谢谢OracleSQLC#
解决方案 »
- oracle数据库连不上,报错输入口令: ERROR: ORA-01033: ORACLE initialization or shutdown in prog
- ORACLE中数据的读取
- 还有一个Oracle触发器问题。。。
- oracle中:如何得到一条记录的插入日期????
- 大家推荐一本PL/SQL 入门的书
- 请教windows下oracle DG 问题
- 插入整点时间瓣问题
- 急啊!刚建立好的数据库,可以正常连上,重启Linux后,再连出现“无法解析描述符中的SID”错误。
- union时报 ORA-12704: 字符集不匹配 错
- 当select语句中同时使用内联和外联,或者多次使用内联或者外联时,其执行的顺序和机理是怎样的?
- 如何去除相同时间段
- oracle查询的问题
select (case when num1>=-30 and num1<-25 then (num2) end) result1,
(case when num1>=-25 and num1<-20 then (num2) end) result2,
(case when num1>=-20 and num1<-15 then (num2) end) result3,
(case when num1>=-15 and num1<-10 then (num2) end) result4,
(case when num1>=-10 and num1<-5 then (num2) end) result5
from test2)t