Skip to content

Instantly share code, notes, and snippets.

@robertberry-zz
Created November 18, 2014 10:33
Show Gist options
  • Save robertberry-zz/ac46d5a70db98c161dc6 to your computer and use it in GitHub Desktop.
Save robertberry-zz/ac46d5a70db98c161dc6 to your computer and use it in GitHub Desktop.
SELECT MAX(c.section_id) section_id, MAX(t.tag_web_title) contributor_name, COUNT(DISTINCT c.id) articles_published
FROM content_dim c RIGHT JOIN content_tag_lookup t ON c.content_key = t.content_key
WHERE t.tag_type = 'contributor'
GROUP BY tag_id, section_id
ORDER BY section_id ASC, articles_published DESC;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment