mysql - Getting the number of connect data while skipping the duplicates -


ok, im sure im going minus sipmly cannot find solution. have table goes this:

date | name ------------- 1       peter 2    |   peter 3    |   peter 3    |   peter 4    |   peter 

and when query:

select distinct count(date) day name 'peter' 

it comes out " 5 " instead of "4"

i tried couple of options , cannot number of times of same name being mentioned in same date while skipping duplicates. lot in advance!

you there, misplaced distinct keyword. way placed mysql select distinct counts rather distinct dates. try placing so:

select count(distinct date) day name 'peter' 

this way mysql distinct dates, intended.


Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -