1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| select count (*)
from CPA_SUIVI_APPEL_9_AIDANT_PROCH,CPA_SUIVI_APPEL_9
where CPA_SUIVI_APPEL_9_AIDANT_PROCH.SA9AP_SA9 = CPA_SUIVI_APPEL_9 .SA9_ID and
CPA_SUIVI_APPEL_9.SA9_REVISION in (
select sa111213_id
from cpa_suivi_appel_11_12_13, cpa_appel
where sa111213_statut = '1'
and sa111213_appel = app_id
and app_beneficiaire_pers_phys = personne_physique.pp_id
and app_statut = '1'
group by sa111213_id,sa111213_revision_date
having min(abs(to_date(to_char (:ad_date_deb,'dd/mm/yyyy'),'dd/mm/yyyy') - to_date(to_char(sa111213_revision_date,'dd/mm/yyyy'),'dd/mm/yyyy'))) =
(select min(abs(to_date(to_char(:ad_date_deb,'dd/mm/yyyy'),'dd/mm/yyyy') - to_date(to_char(sa111213_revision_date,'dd/mm/yyyy'),'dd/mm/yyyy')))
from cpa_suivi_appel_11_12_13,
cpa_appel
where sa111213_statut = '1'
and sa111213_appel = app_id
and app_beneficiaire_pers_phys = cig_personne_physique.pp_id
and app_statut = '1')) |
Partager