title: Overcoming Extra Rows
body: <p>I have to INSERT multiple columns from different tables but keep having the same problem.</p>
  
  <p>The problem is this: I can INSERT the column from TableA.ColumnA into TableB.ColumnA no problem. But next I need to INSERT TableC.columnA into TableB.columnB and this INSERT command adds extra rows are  that change the id's of the data. </p>
  
  <p>My insert commands, plus the UPDATE command I was executing to get the id's to match (unsuccessfully) is below. </p>
  
  <p>I know that the insert command can add extra rows but how do I get passed this so that the id's match? </p>
  
  <p>I thought that maybe the columns had auto increment set but they do not -- so that does not seem to be the problem. Any help is greatly appreciated.</p>
  
  <pre><code>(1) INSERT INTO users_posts 
             (author_id, 
              post_id, 
              post_title)  
      SELECT contents.user_id, contents.id, contents.title 
      FROM contents 
      WHERE contents.id = id
  
  (2) INSERT INTO users_posts 
             (post_content)  
      SELECT content_bodies.content 
      FROM content_bodies 
      WHERE content_bodies.id = id
  
  (3) UPDATE users_posts 
      SET post_content  = (SELECT content_bodies.content  
                           FROM content_bodies  
                           WHERE content_bodies.id = users_posts.post_id)
  </code></pre>