UPDATE edit_decisions SET stage_id=3 WHERE stage_id IS NULL UPDATE edit_decisions ed, review_rounds rr SET ed.review_round_id = rr.review_round_id WHERE rr.round = ed.round AND rr.submission_id = ed.submission_id UPDATE edit_decisions ed, review_rounds rr SET ed.review_round_id = rr.review_round_id WHERE rr.round = ed.round AND rr.submission_id = ed.submission_id UPDATE edit_decisions SET review_round_id = rr.review_round_id FROM review_rounds rr WHERE rr.round = edit_decisions.round AND rr.submission_id = edit_decisions.submission_id