title: Update column from another table column value
body: <p>I'm trying to update user_id column on comments table from comment_users table user_id column value whhich comment_id matches on comments table id columns.    </p>
  
  <p><strong>comment_users table</strong></p>
  
  <pre><code>id: 5 comment_id: 1, user_id: 20
  </code></pre>
  
  <p><strong>comments table</strong><br>
  before</p>
  
  <pre><code>id:1 user_id: NULL
  </code></pre>
  
  <p>after</p>
  
  <pre><code>id: 1 user_id: 20
  </code></pre>
  
  <p>I executed sql below but it doesn't work.</p>
  
  <pre><code>UPDATE comments
    SET user_id = comment_users.user_id
    INNER JOIN comment_users ON comment_users.comment_id = comments.id
    WHERE comment_users.comment_id = comments.id
  
  
  Mysql2::Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INNER JOIN comment_users ON comment_users.comment_id = comment' at line 3:       UPDATE comments
        SET user_id = comment_users.user_id
        INNER JOIN comment_users ON comment_users.comment_id = comments.id
        WHERE comment_users.comment_id = comments.id
  </code></pre>
  
  <p>I have no idea about what is wrong.</p>