Last active
July 2, 2018 09:34
-
-
Save LeoMcA/d881a997fc2e969bd2a894cd884f93e8 to your computer and use it in GitHub Desktop.
Get notification level statistics for a Discourse category
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT replace(replace(replace(replace(replace(cast(notification_level AS varchar), '0', 'muted'), '1', 'regular'), '2', 'tracking'), '3', 'watching'), '4', 'watching first post') AS notification_level, count(*) FROM category_users WHERE category_id=(SELECT id FROM categories WHERE slug='development' AND parent_category_id=(SELECT id FROM categories WHERE slug='add-ons' AND parent_category_id IS NULL)) GROUP BY notification_level; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment