title: Update SQL statement only if two values match in another table
body: <p>I have been searching for this scenario that has come across my desk, I have been searching reference sites but haven't had luck creating the correct SQL statement to complete this task.</p>
  
  <p>Here is the PSEUDO code for the scenario.</p>
  
  <pre><code>UPDATE TABLE1
  SET TABLE1.ID = TABLE1.From_ID,
      TABLE1.VALUE = 'ALL'
  WHERE TABLE1.From_ID = TABLE2.ID
    AND TABLE2.NAME = 'TEST'
  </code></pre>
  
  <p>Basically I need to update two columns in TABLE1 only if the id from TABLE1 matches the ID's in the TABLE2 and the description column in TABLE2 equals to a string value the caveat is that TABL1 columns can't be change only if there is a correlation between the ID's from TABLE1 and TABLE2 and in TABLE2 that ID correlates to description column for a specific string value. Below is table structure and end result I'm trying to get too. </p>
  
  <p><code>TABLE1</code>:</p>
  
  <pre><code>FIELD_ID    CONDITIONAL_VALUE   FROM_FIELDID
  --------------------------------------------   
     1        TEST                   3
     7        TEST                   4
     5        ANY                    7
  </code></pre>
  
  <p><code>TABLE2</code>:</p>
  
  <pre><code>FIELD_ID   Description
  ----------------------------------------------
     3       BLUE
     4       BLUE
     7       RED
  </code></pre>