|
-
January 31st, 2008, 09:02 AM
#1
Count number of Records which have x fields completed
I have a MySQL database with these 3 fields in one of the tables:
Cell_No, Work_No, Home_No
I need to calculate how many records have only 1 of the fields completed.
E.g. Some example Data:
Name Cell_No Work_No Home_No
John 082123123 021482112 [null]
Mary 082442112 [null] [null]
Mike [null] 021343222 [null]
Andrew [null] 012323241 [null]
I need to do a query which will be used for a report on how many records have 1 number completed, how many have 2 numbers completed, etc.
In the above example it would be:
1 number: 3
2 numbers: 1
I was hoping I could do it with the Count() function but I cannot find any examples on using it for this sort of function. I assume it probably can't do it.
Can anyone suggest how I could accomplish this?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|