title: MySQL Update with multiple Columns and databases
body: <p>I have this script below which should update the <code>subscriber_id</code> in <code>subscriber_users</code> with the <code>id</code> from <code>subscriber</code> where the <code>email</code> from <code>subscriber</code> is in the oldDB.table as <code>emailSubscriber</code></p>
  
  <pre><code>UPDATE subscription_users AS u
  JOIN subscriber AS s
  ON u.subscriber_id = s.id
  set u.subscriber_id = s.id
  where s.email IN (SELECT `emailSubscriber` FROM oldDB.table);
  </code></pre>
  
  <p>This code runs without any error, but the <code>id</code> in <code>subscriber</code> will never be set. So i'm guessing that the subselect won't work.</p>
  
  <p>By the point this Querys runs <code>u.subscriber_id</code> is <code>null</code> and this Query won't select any entries nor update any. But i can gurantee that there are matching entries and the update should work.</p>
  
  <p>What am i doing wrong?</p>
  
  <p><strong>Trying to clearify things.</strong></p>
  
  <p>I have three tables:</p>
  
  <p><code>subscriber</code> with the field <code>id</code> and <code>email</code></p>
  
  <p><code>subscriber_users</code> with the field <code>subscriber_id</code>. </p>
  
  <p><code>subscriber_users</code> stands in a OneToMany relationship to <code>subscriber</code>.</p>
  
  <p>Then there is an the <code>table</code> in another <strong>database</strong> with the field <code>emailSubscriber</code>.</p>
  
  <p>I need a way to add the <code>id</code> from <code>subscriber</code> to the <code>subscriber_id</code> from <code>subscribers_users</code> when <code>subscriber.email</code> is in the <code>emailSubscriber</code> field from <code>oldDatabase.table</code>.</p>
  
  <p>I think that the join is missleading and can't work because <code>subscriber_users.subscriber_id</code> is <code>null</code>, so of course there's no value to join. That's an error in my thought process.</p>
  
  <p>This is the structure for subscriber</p>
  
  <p><img src="https://i.stack.imgur.com/WO6Uc.png" alt="subscriber structure"></p>
  
  <p>This is the structure for subscription_users</p>
  
  <p><img src="https://i.stack.imgur.com/eeSFs.png" alt="subcription_users structure"></p>
  
  <p>The relation is the following:</p>
  
  <pre><code>1 subscriber - X subscription_users
  </code></pre>