這種有 in和直接關聯表,哪種更合適一點,tc_cec_file 可以加當年的時間范圍,就2,3萬條資料
select tc_cecplant,count(distinct tc_cec016) from tc_cec_file where tc_cec016
in (select ta_oea036
from sf001.azt_file,sf001.oea_file,sf001.gea_file,sf001.oga_file
where oeaplant = azt01
and oea01 = oga16
and azt05 = gea01(+)
and ogaconf = 'Y'
and oga01 not in (select oha16 from oha_file where ohaud21='1' and ohaconf='Y' and oha55='1')
and ogaud21='1'
AND oeaconf='Y' AND ta_oea042='Y' and oea01 like '411%'
and oga02 between to_date('20190401','yyyymmdd') and to_date('20190412','yyyymmdd') )
and tc_cec064 = '3'
group by tc_cecplant
select tc_cecplant,count(distinct tc_cec016) from tc_cec_file,oga_file,azt_file,oea_file
where oeaplant = azt01
and oea01 = oga16
and ogaconf = 'Y'
and oga01 not in (select oha16 from oha_file where ohaud21='1' and ohaconf='Y' and oha55='1')
and ogaud21='1'
AND oeaconf='Y' AND ta_oea042='Y' and oea01 like '411%'
and oga02 between to_date('20190301','yyyymmdd') and to_date('20190331','yyyymmdd')
and ta_oea036 = tc_cec016
and tc_cec064 = '3'
and oea01 like '411%'
AND oeaconf='Y'
AND ta_oea042='Y'
group by tc_cecplant
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/46442.html
標籤:基礎和管理
上一篇:批量數量檔案快速畫圖
