Skip to content

Instantly share code, notes, and snippets.

@rdlmda
Last active March 18, 2021 13:46
Show Gist options
  • Save rdlmda/e6363f78893d438917c1bba87326cd4d to your computer and use it in GitHub Desktop.
Save rdlmda/e6363f78893d438917c1bba87326cd4d to your computer and use it in GitHub Desktop.

Revisions

  1. rdlmda revised this gist Mar 18, 2021. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion count.sql
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    SELECT YEAR(post_date) YEAR, MONTH(post_date) MONTH, COUNT(*) COUNT
    FROM wp_posts
    WHERE post_type = 'post'
    WHERE post_type = 'post' AND post_status = 'publish'
    GROUP BY YEAR(post_date), MONTH(post_date);
  2. rdlmda created this gist Feb 23, 2021.
    4 changes: 4 additions & 0 deletions count.sql
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,4 @@
    SELECT YEAR(post_date) YEAR, MONTH(post_date) MONTH, COUNT(*) COUNT
    FROM wp_posts
    WHERE post_type = 'post'
    GROUP BY YEAR(post_date), MONTH(post_date);