Home > database >  The great spirit of Sql statements, look at the quick more accord with the actual needs
The great spirit of Sql statements, look at the quick more accord with the actual needs

Time:09-18

This is in and directly linked list, which is more suitable, tc_cec_file can add in those days the time range, 2, 3, ten thousand data

The select tc_cecplant, count (distinct tc_cec016) from tc_cec_file where tc_cec016
In (select ta_oea036
The 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





The 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'

the and oea01 like '411%'AND oeaconf='Y'
AND ta_oea042='Y'
Group by tc_cecplant
  • Related