angel103108 2016-01-26 12:13 采纳率: 0%
浏览 1353

oracle sql查询语句优化

各位大神,我想问下在生产PLSQL,将****内的注释以后,可以查询出结果(用时:16S秒),否则,SQL就一直处于执行状态,查询不出结果。在线等,求各位大神们解惑

select cs.P_VOICEDIAL_FLAG PVoicedialFlag,
   cs.pri_card_nbr priCardNbr,
   cs.total_bal totalBal,
   cs.overdue_amount totalOdue,
   cs.risk_score riskScore,
   ci.instant_queue_user instantQueueUser,
   ci.assist_user assistUser,
   ci.dept_id dept,
   de.name_ deptName,
   ci.allot_reason allotReason,
   (trunc(ci.close_datetime) - trunc(sysdate) + 1) validateDay,
   cs.ab_branch branch,
   ci.case_business_type caseBusinessType,
 ****  ci.case_list_state caseListSate,--队列名称
   ci.CASE_CODE caseId,--案件编号
   ci.CUST_NAME cName,--客户姓名
        ****
   ci.cust_nbr idNumber,
   ci.instant_queue instantQueue,
   cs.BILL_DATE billingDate,
   cs.total_debt totalAmount,
   cs.MOTHS moths,
   cs.capital capital,
   ci.FOLLOW_DATE followDate,
   cs.PTP_FLAG promiseFlg,
   ci.COLLECTOR currCollector,
   ci.team_code currTeam,
   cs.date_into_collect inputDate,
   ci.ALLOT_DATE alloDate,
   ci.ALLOT_USERNAME alloName,
   ci.model_code modelCode

from armc_case_info ci
left outer join bdf2_dept de
on ci.bank_code = de.company_id_
and ci.dept_id = de.id_
left outer join ARMC_CUST_SUM cs
on ci.bank_code = cs.bank_code
and ci.inst_code = cs.inst_code
and ci.cust_nbr = cs.cust_nbr
and ci.biz_type = cs.biz_type
left outer join ARMC_CASE_STATE st
on ci.bank_code = st.bank_code
and ci.inst_code = st.inst_code
and ci.cust_nbr = st.cust_nbr
and ci.biz_type = st.biz_type
where 1 = 1
and cs.safe_mode_flag = 0
and ci.model_code = 'TDC'
and ci.curr_state = 'OPE'
and ci.case_business_type != 'WITH'
ORDER BY cs.total_debt desc

  • 写回答

2条回答

  • devmiao 2016-01-26 15:54
    关注
    评论

报告相同问题?

悬赏问题

  • ¥15 gwas 分析-数据质控之过滤稀有突变中出现的问题
  • ¥15 没有注册类 (异常来自 HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))
  • ¥15 知识蒸馏实战博客问题
  • ¥15 用PLC设计纸袋糊底机送料系统
  • ¥15 simulink仿真中dtc控制永磁同步电机如何控制开关频率
  • ¥15 用C语言输入方程怎么
  • ¥15 网站显示不安全连接问题
  • ¥15 51单片机显示器问题
  • ¥20 关于#qt#的问题:Qt代码的移植问题
  • ¥50 求图像处理的matlab方案