0
$\begingroup$

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: enter image description here

$\endgroup$

1 Answer 1

1
$\begingroup$

This solved the problem:

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

I am using PostgreSQL.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.