Yo probaría así:
Código SQL:
Ver originalSELECT COUNT(C.contrato_rk) contratos
FROM ci_contact_history_cont_ext C
WHERE EXISTS
(
SELECT COUNT(1)
FROM ci_contact_history_cont P
WHERE P.cell_package_sk = C.cell_package_sk AND
P.contrato_rk=C.contrato_rk AND
P.CONTACT_DTTM=c.CONTACT_DTTM
)
AND C.CONTACT_DTTM >= to_date( '19/12/2008 12:11:33','dd/mm/yyyy HH24:MI:SS');
o bien así:
Código SQL:
Ver originalSELECT COUNT(C.contrato_rk) contratos
FROM ci_contact_history_cont_ext C, ci_contact_history_cont P
WHERE P.cell_package_sk = C.cell_package_sk
AND P.contrato_rk=C.contrato_rk
AND P.CONTACT_DTTM=c.CONTACT_DTTM
AND C.CONTACT_DTTM >= to_date( '19/12/2008 12:11:33','dd/mm/yyyy HH24:MI:SS');
También me plantearía crear un indice en ci_contact_history_cont_ext sobre el campo CONTACT_DTTM