码农_Aaron 2014-04-17 02:52
浏览 750

sql 调优 oracle 执行速度再快一点

select psf.pol_num, psf.bank_acct_num, cba_dda.bank_acct_nm
from   tbank_pos_slip_files psf, tclient_policy_links cpl_dda, tclient_bank_accounts cba_dda
where  cpl_dda.cli_num = cba_dda.cli_num
and    cpl_dda.bank_acct_typ = cba_dda.bank_acct_typ
and    cpl_dda.link_typ = 'O'
and    psf.bank_acct_num = cba_dda.bank_acct_num
and    psf.trade_role = 'C'
and    psf.mtch_ind = 'Y'
and    psf.mtch_dt between to_date('2013/11/01', 'yyyy/mm/dd') and to_date('2013/11/30', 'yyyy/mm/dd')
      --and (p_terr_cd = '*' or instr(p_terr_cd, psf.pos_terr_cd ||'/') > 0)
and    not exists (select 'Y'
        from   tclient_policy_links cpl, tclient_details cli
        where  cpl.cli_num = cli.cli_num
        and    cpl.link_typ in ('I', 'O')
        and    cpl.pol_num = psf.pol_num
        and    cli.cli_nm = cba_dda.bank_acct_nm
        union all
        select 'Y'
        from   tbeneficiary_details bft
        where  bft.pol_num = psf.pol_num
        and    bft.bnfy_nm = cba_dda.bank_acct_nm)
union
select psf.pol_num, psf.bank_acct_num, cba_dca.bank_acct_nm
from   tbank_pos_slip_files psf, vclient_policy_links cpl_dca, tclient_bank_accounts cba_dca
where  cpl_dca.cli_num = cba_dca.cli_num
and    cpl_dca.payo_bank_acct_typ = cba_dca.bank_acct_typ
and    psf.bank_acct_num = cba_dca.bank_acct_num
and    psf.trade_role = 'C'
and    psf.mtch_ind = 'Y'
and    psf.mtch_dt between to_date('2013/11/01', 'yyyy/mm/dd') and to_date('2013/11/30', 'yyyy/mm/dd')
      --and (p_terr_cd = '*' or instr(p_terr_cd, psf.pos_terr_cd ||'/') > 0)
and    not exists (select 'Y'
        from   tclient_policy_links cpl, tclient_details cli
        where  cpl.cli_num = cli.cli_num
        and    cpl.link_typ in ('I', 'O')
        and    cpl.pol_num = psf.pol_num
        and    cli.cli_nm = cba_dca.bank_acct_nm
        union all
        select 'Y'
        from   tbeneficiary_details bft
        where  bft.pol_num = psf.pol_num
        and    bft.bnfy_nm = cba_dca.bank_acct_nm)
  • 写回答

0条回答

    报告相同问题?

    悬赏问题

    • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
    • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
    • ¥20 有关区间dp的问题求解
    • ¥15 多电路系统共用电源的串扰问题
    • ¥15 slam rangenet++配置
    • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
    • ¥15 ubuntu子系统密码忘记
    • ¥15 保护模式-系统加载-段寄存器
    • ¥15 电脑桌面设定一个区域禁止鼠标操作
    • ¥15 求NPF226060磁芯的详细资料