i have a table with the following fields (among others)
id
priority
name
i need to count the number of records for each name grouped by priority, my problem is that where there are several records with the same id number for a particular name/priority i only want the result to return 1.
for example:
id priority name
001 A fred bloggs
002 A fred bloggs
002 A fred bloggs
003 A john smith
003 A john smith
004 B john smith
would return:
Count priority name
2 A fred bloggs
1 A john smith
1 B john smith
i'm sure this should be fairly straightforward but i just can't get my head around it. Any help appreciated
Cheers, Craig
Si fractum non sit, noli id reficere
id
priority
name
i need to count the number of records for each name grouped by priority, my problem is that where there are several records with the same id number for a particular name/priority i only want the result to return 1.
for example:
id priority name
001 A fred bloggs
002 A fred bloggs
002 A fred bloggs
003 A john smith
003 A john smith
004 B john smith
would return:
Count priority name
2 A fred bloggs
1 A john smith
1 B john smith
i'm sure this should be fairly straightforward but i just can't get my head around it. Any help appreciated
Cheers, Craig
Si fractum non sit, noli id reficere