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 求学软件的前人们指明方向🥺
  • ¥50 如何增强飞上天的树莓派的热点信号强度,以使得笔记本可以在地面实现远程桌面连接
  • ¥15 MCNP里如何定义多个源?
  • ¥20 双层网络上信息-疾病传播
  • ¥50 paddlepaddle pinn
  • ¥20 idea运行测试代码报错问题
  • ¥15 网络监控:网络故障告警通知
  • ¥15 django项目运行报编码错误
  • ¥15 STM32驱动继电器
  • ¥15 Windows server update services