Superstar Rajinikanth
Superstar Rajinikanth

Reputation: 23

I need just the count of unique phone numbers in my mySql table. How do I do that?

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

Answers (2)

SELECT COUNT(DISTINCT COLUMN_NAME) 
FROM TABLE_NAME 

I think this is what you are looking for??

Upvotes: 4

Bjoern
Bjoern

Reputation: 16304

I might be simplifying this a bit..

SELECT COUNT(DISTINCT phonenumber)
FROM yourtable;

Upvotes: 2

Related Questions