Hi, I am trying to work out how to get a unique count for the following table:
ID | Agent
11 | 1
11 | 1
11 | 2
22 | 3
22 | 3
I write the following query:
which gives me the total of agents:
ID | CountofAgent
11 | 3
22 | 2
but what i would like is to have a unique count of agents, with the following results:
ID | CountofAgent
11 | 2
22 | 1
Can any1 help please?
Thanks in advance.
ID | Agent
11 | 1
11 | 1
11 | 2
22 | 3
22 | 3
I write the following query:
Code:
SELECT Table1.ID, Count(Table1.Agent) AS CountOfAgent
FROM Table1
GROUP BY Table1.ID;
which gives me the total of agents:
ID | CountofAgent
11 | 3
22 | 2
but what i would like is to have a unique count of agents, with the following results:
ID | CountofAgent
11 | 2
22 | 1
Can any1 help please?
Thanks in advance.