I am trying to display the 'Archived Posts' from the WordPress Database like this (but using ColdFusion to display the data) and need help on the SQL query.
Example:
January 2019 (1 post)
December 2018 (3 posts)
September 2017 (1 post)
My query looks like this:
SELECT wp_posts.post_date, post_type, post_status
FROM wp_posts
WHERE wp_posts.post_type = "post"
AND wp_posts.post_status = "publish"
GROUP BY YEAR(post_date), MONTH(post_date) DESC
That gives me the following error:
"Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'dnr_wordpress.wp_posts.post_date' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by"