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
Post a Comment