How to update wp_posts with just the returned comment count from wp_comments (SQL GROUP BY)

The easy way is to just write PHP to go through all the posts and call wp_update_comment_count() on each post ID.