title: SQL: How to determine and skip the unique constraint when doing update?
body: <p>I'm writing a SQL (Oracle) to update a table with the values in another table.  But since there is a 2 column unique constraint, the update always failed. It is something like this:</p>
  
  <pre><code>Table A
  - A_1
  - A_2
  - A_3
  (There is a unique constraint for A_1 + A_3 )
  
  Table B
  - B_1
  - B_2
  </code></pre>
  
  <p>Here is my current sql:</p>
  
  <pre><code>UPDATE A a
  SET a.A_1 =
      (SELECT b.B_1
      FROM B b
      WHERE a.A_2 = b.B_2
      )
  AND EXISTS
      (SELECT b.B_1
      FROM B b
      WHERE a.a.A_2 = b.B_2
      )
  </code></pre>
  
  <p>I want to skip the lines that violate the unique constraint but I don't know how to do it. Please advise. Thank you!</p>