Invalid query: Whole query: SELECT YEAR(pub_time) y, MONTH(pub_time) m, DAY(pub_time) d FROM news GROUP BY YEAR(pub_time), MONTH(pub_time), DAY(pub_time) ORDER BY pub_time ASC