Skip to content

Instantly share code, notes, and snippets.

@fredrike
Created March 28, 2014 09:39
Show Gist options
  • Save fredrike/9828967 to your computer and use it in GitHub Desktop.
Save fredrike/9828967 to your computer and use it in GitHub Desktop.
update post_play set likes_count=(select count(*) from likedby as ls where ls.page_id=post_play.page_id AND ls.post_id=post_play.id AND ls.comment_id=0) WHERE likes_count IS NULL limit 1000000;
update post_play set comments_count=(select count(*) from comment co where co.page_id=post.page_id AND co.post_id=post.id) WHERE comments_count IS NULL limit 1000000;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment