Getting the earliest date (duplicates due to several call ids and agents) I am trying to get the earliest call interaction, with only the agent that interacted at that call and the customer id. Using the following code, I still get duplicates:

select customer, agent, min(call)
from call_data;


I still get the following:
This solved the problem:

select distinct on (customer)
customer, agent, min(call)
from call_data;



I am using PostgreSQL.