主頁(yè) > 知識(shí)庫(kù) > oracle join on 數(shù)據(jù)過濾問題

oracle join on 數(shù)據(jù)過濾問題

熱門標(biāo)簽:修改高德地圖標(biāo)注 百變地圖標(biāo)注 語音電話機(jī)器人缺點(diǎn) 語音電話機(jī)器人營(yíng)銷方案 宜賓外呼系統(tǒng)廠家 淮安自動(dòng)外呼系統(tǒng)開發(fā) 地圖標(biāo)注原件 南通防封外呼系統(tǒng)運(yùn)營(yíng)商 廣州市400電話辦理
復(fù)制代碼 代碼如下:

select a.f_username
from
(
SELECT /*+parallel(gu,4)*/distinct gu.f_username
FROM t_base_succprouser gu
where gu.f_expectenddate > (select trunc(sysdate,'Y')FROM DUAL)
and gu.f_lotid=1
and gu.f_playid=4
and gu.f_paymoney>=1500
) A
left join
(
select
from t_base_vip_customes
and ((vu.f_passeddate is null ) or (vu.f_passeddate > trunc(sysdate,'Y') ))
and ((vu.f_lotid is null ) or (vu.f_lotid=1))
and ((vu.f_playid is null ) or (vu.f_playid=4))
and ((vu.f_condtionid is null ) or (vu.f_condtionid=3))
)B
on A.f_username=B.f_usernam
where b.f_username is null

采用下面的語句 只能查出部分用戶
復(fù)制代碼 代碼如下:

SELECT /*+parallel(gu,4)*/distinct gu.f_username
FROM t_base_succprouser gu
left join t_base_vip_customes VU on gu.f_username=vu.f_username
gu.f_expectenddate > (select trunc(sysdate,'Y')FROM DUAL)
and gu.f_lotid=rec_viplotplay.f_lotid
and gu.f_playid=rec_viplotPlay.f_Playid
and gu.f_paymoney>=rec_viplotPlay.F_Conditon_ValuesA
and ((vu.f_passeddate is null ) or (vu.f_passeddate > trunc(sysdate,'Y') ))
and ((vu.f_lotid is null ) or (vu.f_lotid=rec_viplotplay.f_lotid))
and ((vu.f_playid is null ) or (vu.f_playid=rec_viplotPlay.f_Playid))
and ((vu.f_condtionid is null ) or (vu.f_condtionid=rec_viplotPlay.F_CondtionID))
and vu.f_username is null

執(zhí)行計(jì)劃:
復(fù)制代碼 代碼如下:

SELECT STATEMENT, GOAL = ALL_ROWS
HASH UNIQUE
NESTED LOOPS OUTER
PARTITION RANGE ALL
TABLE ACCESS FULL Object name=T_BASE_SUCCPROUSER
VIEW
FILTER
TABLE ACCESS FULL Object name=T_BASE_VIP_CUSTOMES
FAST DUAL

后來改成了下面就能全部查出來了
復(fù)制代碼 代碼如下:

SELECT /*+parallel(gu,4)*/distinct gu.f_username
FROM t_base_succprouser gu
left join t_base_vip_customes VU on gu.f_username=vu.f_username
and ((vu.f_passeddate is null ) or (vu.f_passeddate > trunc(sysdate,'Y') ))
and ((vu.f_lotid is null ) or (vu.f_lotid=rec_viplotplay.f_lotid))
and ((vu.f_playid is null ) or (vu.f_playid=rec_viplotPlay.f_Playid))
and ((vu.f_condtionid is null ) or (vu.f_condtionid=rec_viplotPlay.F_CondtionID))

where gu.f_expectenddate > (select trunc(sysdate,'Y')FROM DUAL)
and gu.f_lotid=rec_viplotplay.f_lotid
and gu.f_playid=rec_viplotPlay.f_Playid
and gu.f_paymoney>=rec_viplotPlay.F_Conditon_ValuesA
and vu.f_username is null
執(zhí)行計(jì)劃:
SELECT STATEMENT, GOAL = ALL_ROWS
HASH UNIQUE
FILTER
NESTED LOOPS OUTER
TABLE ACCESS BY GLOBAL INDEX ROWID Object name=T_BASE_SUCCPROUSER
INDEX RANGE SCAN Object name=IX_BASE_PROUSER_LOWEX
FAST DUAL
VIEW
TABLE ACCESS FULL Object name=T_BASE_VIP_CUSTOMES

oracle 不懂先把數(shù)據(jù)給過濾掉然后在來連接嗎? 太笨了!而且這樣把符合條件的數(shù)據(jù)也過濾掉了

標(biāo)簽:池州 股票投資 南平 襄陽(yáng) 南平 通化 聊城 嘉峪關(guān)

巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《oracle join on 數(shù)據(jù)過濾問題》,本文關(guān)鍵詞  oracle,join,數(shù)據(jù),過濾,問題,;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問題,煩請(qǐng)?zhí)峁┫嚓P(guān)信息告之我們,我們將及時(shí)溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無關(guān)。
  • 相關(guān)文章
  • 下面列出與本文章《oracle join on 數(shù)據(jù)過濾問題》相關(guān)的同類信息!
  • 本頁(yè)收集關(guān)于oracle join on 數(shù)據(jù)過濾問題的相關(guān)信息資訊供網(wǎng)民參考!
  • 推薦文章