title: SQL SERVER : having two where conditions in one update statement
body: <p>So, I want to update a table with one update statement. However I have two where conditions. Meaning say the table in question (tableA) has 5 columns out of which 3 columns are updated using tableB and rest 2 are updating using tableC.
  For example:</p>
  
  <pre><code>update A
  Set col1 = B.colx,
      col2 = B.coly,
      col3 = B.colz
  From TableA A
    INNER JOIN TableB B
    ON A.col = B.colr
   Where B.colw = 'xx' AND B.colu = 'yy'
  
  
  Update A
  SET col4 = C.Cola
      col5 = C.Colb
  FROM tableA A
   Inner join tableC C
   ON A.col= C.cols
  WHERE C.colk= 'ddd' and C.colj = 'lll'
  </code></pre>
  
  <p>Please help ! Thanks !</p>
  
  <p>-------   Suggested code -----</p>
  
  <p>Can I use ?</p>
  
  <pre><code>update A
      Set col1 = B.colx,
          col2 = B.coly,
          col3 = B.colz,
          col4 = C.Cola,
          col5 = C.Colb
      From TableA A
        INNER JOIN TableB B
        ON A.col = B.colr
            INNER JOIN TableC C
            ON A.col=C.cols
       Where (B.colw = 'xx' AND B.colu = 'yy') OR (C.colk= 'ddd' and C.colj = 'lll')
  </code></pre>