How can I display the least factor by ID_ACORDO?
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