SELECT
LEFT(c.created_at, 10) AS aaa,
COUNT(*) AS task_count
FROM {{task_info}} AS c
LEFT JOIN {{admin_user}} AS a
ON c.created_by = a.id
WHERE a.department_id = :department_id
GROUP BY aaa
ORDER BY aaa DESC
LEFT(c.created_at, 10) AS aaa,
COUNT(*) AS task_count
FROM {{task_info}} AS c
LEFT JOIN {{admin_user}} AS a
ON c.created_by = a.id
WHERE a.department_id = :department_id
GROUP BY aaa
ORDER BY aaa DESC