Posts Tagged with mysql distinct

Displaying 1-1 of 1 result.
Resolved: MySQL - Count Number of Unique Values
posted by admin on May 21, 2016
If I have three columns:

orderNumber, name, email

and I would like to count how many unique emails are in the table how would I go about doing so?

A statement like:

SELECT count(email) FROM orders

gives me the total count.
I tried

SELECT DISTINCT count(email) FROM orders

but that does not seem to be giving me the numbers I am expecting.Read more