Reputation: 23
I have a mySQL table with list of people and phone numbers. There are some repeats in these phone numbers. I don't want to remove the duplicates based on the phone numbers as a same phone number is related to more that one entity. I just want the count of unique phone numbers in the phone number column. How do I do this?
Upvotes: 2
Views: 99
Reputation: 1901
SELECT COUNT(DISTINCT COLUMN_NAME)
FROM TABLE_NAME
I think this is what you are looking for??
Upvotes: 4
Reputation: 16304
I might be simplifying this a bit..
SELECT COUNT(DISTINCT phonenumber)
FROM yourtable;
Upvotes: 2