title: UPDATE table SET related_id=NULL WHERE related_id doesn't exist in related table
body: <p>I need to update <strong><em><code>table</code></em></strong> and set <strong><em><code>table</code></em></strong>.<strong><code>related_id</code></strong> (column that "binds" the table with <strong><em><code>related table</code></em></strong>) to <code>NULL</code> where the <strong><em><code>table</code></em></strong>.<strong><code>related_id</code></strong> doesn't exist in the <strong><em><code>related_table</code></em></strong> as <strong><em><code>related_table</code></em></strong>.<strong><code>id</code></strong>.</p>
  
  <p>example:</p>
  
  <pre><code>TABLE:
  ----------------------
  id | name | related_id
  ----------------------
  1  | aaa  | 15
  2  | bbb  | 36
  3  | ccc  | 7
  4  | xxx  | 43
  
  RELATED_TABLE:
  ----------
  id | name
  ----------
  9  | ddd
  15 | eee
  7  | fff
  </code></pre>
  
  <p>The query I need is supposed to update <strong><em><code>table</code></em></strong> like that:</p>
  
  <pre><code>TABLE:
  ----------------------
  id | name | related_id
  ----------------------
  1  | aaa  | 15
  2  | bbb  | NULL
  3  | ccc  | 7
  4  | xxx  | NULL
  </code></pre>
  
  <p>(because <strong><code>id</code></strong> 36 and 43 doesn't exist in <strong><em><code>related_table</code></em></strong>)</p>
  
  <p>Please, help.</p>