Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT LIGACOES.ID
- ,ACORDO.ID_ACORDO
- ,ACORDO.DATA as 'DATA_ACORDO'
- ,LIGACOES.time_of_contact AS 'DATA_LIGACAO'
- ,ACORDO.data-LIGACOES.time_of_contact as FATOR
- FROM SISCOB_acordo_itau_pf_varejo AS ACORDO
- INNER JOIN
- DWH_Developer.ASPECT_CONTACT_EVENTS AS LIGACOES ON (LIGACOES.account_number = ACORDO.id_contr)
- where ACORDO.DATA>= LIGACOES.time_of_contact
- SELECT ACORDO.ID_ACORDO
- ,min(ACORDO.data-LIGACOES.time_of_contact) as min_FATOR
- FROM SISCOB_acordo_itau_pf_varejo AS ACORDO
- INNER JOIN
- DWH_Developer.ASPECT_CONTACT_EVENTS AS LIGACOES ON (LIGACOES.account_number = ACORDO.id_contr)
- where ACORDO.DATA>= LIGACOES.time_of_contact
- group by ACORDO.ID_ACORDO
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement