Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save jonathanstegall/3681ce99e5e001e34e941a7e2db176eb to your computer and use it in GitHub Desktop.
Save jonathanstegall/3681ce99e5e001e34e941a7e2db176eb to your computer and use it in GitHub Desktop.
show how many comments are submitted by month/year
SELECT MONTH(FROM_UNIXTIME(timestamp)) as month, YEAR(FROM_UNIXTIME(timestamp)) as year, count(cid) as comment_count
FROM comments
WHERE timestamp >= UNIX_TIMESTAMP('2014-07-15 00:00:00')
GROUP BY year, month;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment