Adamski Adamski - 5 months ago 9
MySQL Question

Can I use COUNT() and DISTINCT together?

I would like to count the number of rows from a mysql table and not to include duplicate entries,

Could I use

distinct
with
count()
?

Answer

Sure.

SELECT COUNT(DISTINCT column) FROM table;
Comments