Skip to content

Instantly share code, notes, and snippets.

@onli
Created December 16, 2024 16:07
Show Gist options
  • Save onli/045fa66377fec28cb59fcc15c5996dcb to your computer and use it in GitHub Desktop.
Save onli/045fa66377fec28cb59fcc15c5996dcb to your computer and use it in GitHub Desktop.
Count all comments in a year
SELECT serendipity_entries.title, COUNT(*) as amount FROM serendipity_entries INNER JOIN serendipity_comments ON serendipity_entries.id = serendipity_comments.entry_id WHERE serendipity_comments.timestamp > 1704067211 AND type = 'NORMAL' GROUP BY serendipity_entries.title ORDER BY amount;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment