Skip to content

Instantly share code, notes, and snippets.

@pikajude
Created July 24, 2014 18:07
Show Gist options
  • Save pikajude/e913af2dfc9361e4d930 to your computer and use it in GitHub Desktop.
Save pikajude/e913af2dfc9361e4d930 to your computer and use it in GitHub Desktop.
UPDATE posts SET reply_count = (SELECT count(*) FROM posts AS p2 WHERE p2.reply_to_post_number = posts.post_number)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment