mysql - Count the number of different column values on every day -
i have table:
`tasks` (`id`, `url_id`, `task`, `date`) task can values: 1, 2, 3. date unix timestamp. how data saying how many tasks performed on everyday url_id = 1. expected result is:
{`count_task_1`: 30, `count_task_2`: 14, `count_task_3`: 30, `date`='2011-03-12'}, [..] something give me number of entries on day url_id=1:
select count(`id`) `tasks` `url_id`=1 group date(from_unixtime(`date`)); the options see: multiple queries or sub queries (which pretty same).
thank jink helping me solve question.
select `task`, count(`id`) `count`, date(from_unixtime(`date`)) `date` `tasks` `url_id`=3 group `task`, date(from_unixtime(`date`));
Comments
Post a Comment