Advertisement
Guest User

Untitled

a guest
Jul 6th, 2015
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. SELECT LIGACOES.ID
  2. ,ACORDO.ID_ACORDO
  3. ,ACORDO.DATA as 'DATA_ACORDO'
  4. ,LIGACOES.time_of_contact AS 'DATA_LIGACAO'
  5. ,ACORDO.data-LIGACOES.time_of_contact as FATOR
  6.  
  7. FROM SISCOB_acordo_itau_pf_varejo AS ACORDO
  8.  
  9. INNER JOIN
  10. DWH_Developer.ASPECT_CONTACT_EVENTS AS LIGACOES ON (LIGACOES.account_number = ACORDO.id_contr)
  11.  
  12. where ACORDO.DATA>= LIGACOES.time_of_contact
  13.  
  14. SELECT ACORDO.ID_ACORDO
  15. ,min(ACORDO.data-LIGACOES.time_of_contact) as min_FATOR
  16.  
  17. FROM SISCOB_acordo_itau_pf_varejo AS ACORDO
  18.  
  19. INNER JOIN
  20. DWH_Developer.ASPECT_CONTACT_EVENTS AS LIGACOES ON (LIGACOES.account_number = ACORDO.id_contr)
  21.  
  22. where ACORDO.DATA>= LIGACOES.time_of_contact
  23. group by ACORDO.ID_ACORDO
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement