title: update table column using values from another table column
body: <p>I've got two tables that look like this</p>
  
  <pre><code>TABLE_1
  option_id PK,
  condition_id FK,
  </code></pre>
  
  <p>And I has another table that looks like this</p>
  
  <pre><code>TABLE_2
  option_id PK, FK -&gt; TABLE_1
  condition_id PK, FK
  </code></pre>
  
  <p>I want to set <code>condition_id</code> in TABLE_1 with corresponding values for <code>condition_id</code> from TABLE_2. </p>
  
  <p>My script looks like this</p>
  
  <pre><code>UPDATE TABLE_1
  SET 
      condition_id = t2.condition_id
  FROM TABLE_1 t1
  INNER JOIN TABLE_2 t2
  ON t1.option_id = t2.option_id
  </code></pre>
  
  <p>But it seems to be wrong - after the execution all the values of <code>condition_id</code> in <code>TABLE_1</code> are the same.</p>
  
  <p>What is wrong?</p>