UPDATE on SELECT results. A SQL query to swap Author with Meta Box value

I always find it way less confusing to get the results from one table and loop them rather than to try to join them like that… eg.

global $wpdb;
$query = "SELECT post_id FROM wp_postmeta WHERE meta_key='fake_author' AND meta_value="11111"";
$results = $wpdb->get_results($query);

foreach ($results as $result) {
    $query = "UPDATE wp_posts SET post_author="222222" WHERE ID='".$result->post_id."'";
    $wpdb->query($query);
}