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;
Data Science Stack Exchange is a question and answer site for Data science professionals, Machine Learning specialists, and those interested in learning more about the field. It only takes a minute to sign up.
Sign up to join this communityThis solved the problem:
select distinct on (customer)
customer, agent, min(call)
from call_data;
I am using PostgreSQL.