help with a query

sjs01

Registered User.
Local time
Today, 03:54
Joined
Feb 23, 2006
Messages
12
I have a table called 'sets' with 3 fields - spb, pat and set. An example of the table is shown below:

spb pat set
1 123 ue
1 123 lft
2 123 ue
3 123 ue
4 1234 ue
4 1234 lft
5 123 ue
6 1234 lft
For each 'set' I would like to output the total number of requests (a request is defined as having a unique 'spb' value) and the total number of patients (a patient is defined as having a unique 'pat' value), using a single query (if possible). In the above example the output should be:

set Requests Patients
ue 5 2
lft 3 2

Thanks for any help with this.
 
Last edited:

Users who are viewing this thread

Back
Top Bottom