mysql - Group by the date part of a timestamp field -


i have users table. generate report of user joined day. problem is, datejoined field timestamp field,

as query following as:

select count(userid) tot users group datejoined 

does not work, how group by date part , not time of datejoined field?

your code:

select        count(userid) tot        users        group datejoined 

you should chage as:

select         date(datejoined),         count(userid) tot         users         group date(datejoined) 

the sqlfiddle


Comments

Popular posts from this blog

java - WrongTypeOfReturnValue exception thrown when unit testing using mockito -

php - Magento - Deleted Base url key -

android - How to disable Button if EditText is empty ? -