Skip to content

Instantly share code, notes, and snippets.

@jayd3e
Forked from deegoods/gist:1d260ae1b14bfe0d5457
Last active August 29, 2015 14:02
Show Gist options
  • Save jayd3e/1c255e8d559592af3c3f to your computer and use it in GitHub Desktop.
Save jayd3e/1c255e8d559592af3c3f to your computer and use it in GitHub Desktop.
select count(distinct(posts.id)) from posts
left outer join comments on posts.id = comments.post_id
where comments.id is not null and posts.deleted is null and comments.deleted is null;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment