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

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -