Need help - select the number of rows for each unique value in specified field -
09-30-2005
, 04:34 PM
Topics sounds confusing, right? Welcome to my world!
Here's an example. I have a database of phone numbers, such as this:
table: members
field: phone_number
values:
123-456-xxxx
123-234-xxxx
324-667-xxxx
555-767-xxxx
555-876-xxxx
661-661-xxxx
555-555-xxxx
324-324-xxxx
I need to know how many unique area codes there are, and how many
instances of that areas code
e.g.
123 (2)
324 (2)
767 (3)
661 (1)
How, in an SQL SELECT statement, can I do that? I'm not new to SQL, but
this one has me baffled! |