Adamski Adamski - 10 months ago 38
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;