oracle 查询优化select count(*),sum(bal) from rpt_xd where substr(beg_date,5,2)= substr('20130131',5,2) and substr(beg_date,1,4)=substr('20130131',1,4) and term_mon3 and term_mon6 and term_mon12各位能帮我把它变成一句话吗 只有

来源:学生作业帮助网 编辑:作业帮 时间:2024/04/29 23:28:47
oracle 查询优化select count(*),sum(bal)  from rpt_xd where  substr(beg_date,5,2)= substr('20130131',5,2)  and substr(beg_date,1,4)=substr('20130131',1,4)  and term_mon3 and term_mon6 and term_mon12各位能帮我把它变成一句话吗   只有

oracle 查询优化select count(*),sum(bal) from rpt_xd where substr(beg_date,5,2)= substr('20130131',5,2) and substr(beg_date,1,4)=substr('20130131',1,4) and term_mon3 and term_mon6 and term_mon12各位能帮我把它变成一句话吗 只有
oracle 查询优化
select count(*),sum(bal) from rpt_xd where substr(beg_date,5,2)= substr('20130131',5,2) and substr(beg_date,1,4)=substr('20130131',1,4) and term_mon3 and term_mon6 and term_mon12
各位能帮我把它变成一句话吗 只有后面的term_mon条件不同而已 主要就是查询每段term_mon的count(*)和sum(bal)

oracle 查询优化select count(*),sum(bal) from rpt_xd where substr(beg_date,5,2)= substr('20130131',5,2) and substr(beg_date,1,4)=substr('20130131',1,4) and term_mon3 and term_mon6 and term_mon12各位能帮我把它变成一句话吗 只有

晕死,你那个20130131都知道是查2013年1月份的了,你就直接='201301'就好了,substr用多了会造成查询速度缓慢的

竖着显示就union all就好了,像楼上那位说的那样,横着显示这样

select sum(case when term_mon<3 then 1 else 0 end) 小于3数量,
sum(case when term_mon<3 then bal else 0 end) 小于3值,
sum(case when term_mon>3 and term_mon<6 then 1 else 0 end) 大于3小于6数量,
sum(case when term_mon>3 and term_mon<6 then bal else 0 end) 大于3小于6值,
sum(case when term_mon>6 and term_mon<12 then 1 else 0 end) 大于6小于12数量,
sum(case when term_mon>6 and term_mon<12 then bal else 0 end) 大于6小于12值,
sum(case when term_mon>12 then 1 else 0 end) 大于12数量,
sum(case when term_mon>12 then bal else 0 end) 大于12值
from rpt_xd where substr(beg_date,1,6)= '201301'

oracle 多表查询速度太慢.求帮我优化一下select jbjxxid,anjianmingcheng,JBJXXSLBH,SARJBXXID,SARMC,JBDWMC from tb_jbjxx,tb_ajjbxx,tb_sarjbxx,tb_xyr,tb_chengbaoxinxiwhere tb_jbjxx.JBJXXID=tb_ajjbxx.JBJXXSLBH or tb_ajjbxx.QTRYXXSLBH=tb_sarjb oracle 优化查询效率select t.dwmc,t.zgjl,t.zbjl,t.zqjl,t.xljl,t.skjl,t.bgjl, t.bqjl,t.bgjl2,t.pxjl,t.ccjl, (zbjl+zqjl+xljl+skjl+bgjl+bqjl+bgjl2+pxjl+ccjl) as hz from (select code_mean as dwmc, (select count(*) from tableoneb, tabletwo a w oracle查询语句 select a||','||b||','||c from table where a in('m','n') oracle 中见到一个查询语句,select /*+ index(t1) */ from t1 .,其中/*+ oracle 子查询:select *,(select account from t_ps_member m where m.mid = po.mid) account from t_ps oracle 语句 查询优化select count(*),sum(bal) from rpt_xd where substr(beg_date,5,2)= substr('20130131',5,2) and substr(beg_date,1,4)=substr('20130131',1,4) and term_mon3 and term_mon6 and term_mon12能不能帮我弄成一句话啊 这样分着 oracle 查询优化select count(*),sum(bal) from rpt_xd where substr(beg_date,5,2)= substr('20130131',5,2) and substr(beg_date,1,4)=substr('20130131',1,4) and term_mon3 and term_mon6 and term_mon12各位能帮我把它变成一句话吗 只有 实现关系代数表达式的优化算法 .输入:关系代数表达式或SELECT查询语句 输出:优化后的关系代数表达式 oracle查询一个表,select * from a 所有的字段都是浮点型,想保留3个小数,怎么写语句?类似select round(*,3) from a,还是怎么写? oracle表名中带@什么意思,例如:select * from dim.dim_area_no@to_dw 浅析ORACLE数据库的优化方案如何翻译 Oracle中的EXISTS与IN我看到有的帖子上说Oracle SQL中尽量用EXISTS代替IN,但我后来看应该准确讲是:对于带有子表查询的情况,使用EXISTS效率要高于IN,但如果仅仅是字段选择,例如:select * from table whe Oracle查询条件的检索顺序 select * from tabel_1 t where t.aa like '%aaa%' and t.bb like '%ccc%'请问:就上述语句,Oracle的机制会怎样查找符合条件的结果1:先找到符合 bb like ccc 的结果,再从该结果中找 aa lik oracle 语句优化问题select nvl(sum(a.sl),0),nvl(sum(a.je),0)from tablea aleft join tableb bon a.zd = b.zdwhere a.zd2 in ('181','180','179','178','177','176','175')and nvl(b.zd3,'xx') = 'xx'类似这样的语句 zd、zd2是字段 都有索引在p oracle sql语句获取前两条数据select id,seq from hzds_admin where seq select max(account_id ) from(select top 5 account_id from account)子查询没起作用为什么? 一条平常用的查询语句 怎么优化. SELECT