php - MySQL grouping by day then display the date from the grouped results -
so have whole load of votes going voting system. want display how many votes have in 1 day. want then, display amount of votes per day , spit out day voted on, i.e 24k votes on 05/06/12, 27k votes on 06/06/12
select count(*) count results group day(datesubmitted), year(datesubmitted), month(datesubmitted) order day(datesubmitted) desc, year(datesubmitted) desc, month(datesubmitted) desc is query, tried add
day(from_unixtime(datesubmitted)) order_day
but throws null found interesting i'd expect query fail there aren't outers.
why don't group datesubmitted desc? also, no need order if it's following same criteria group by.
Comments
Post a Comment