Adamski Adamski - 1 year ago 67
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 Source

Sure.

SELECT COUNT(DISTINCT column) FROM table;