title: Simple nested query on the same table
body: <p>So this is my table set up of 100k rows. I have around 30k rows which have the wrong dealer associated to it even though it refers to the same person but just a different bank designation. This happened due to a failure to port information accurately from a previous version of the database .</p>
  
  <pre><code>Table CustomerName
  
   Name Bank Dealer SSN
   John  1    ABC    unique1
   Mike  1    DEF    unique2
   Mike  2    wrong  unique2
   Mark  1    XYZ    unique3
   Mark  2    wrong  unique3
  </code></pre>
  
  <p>Desired Table set up</p>
  
  <pre><code>Table CustomerName
  
   Name Bank Dealer  SSN
   John  1    ABC    unique1
   Mike  1    DEF    unique2
   Mike  2    DEF    unique2
   Mark  1    XYZ    unique3
   Mark  2    XYZ    unique3
  </code></pre>
  
  <p>I want to write a query which will target the rows (Bank 2 rows essentially) and change it to Bank 1 Dealer values. Is there a way to do it ? I'm using T-SQL ( SSMS 2016 ) </p>
  
  <p>EDIT : 
  SSN are like primary keys for the customer. every customer will have one ssn . the bank 2 is basically a delinquent account bank. A customer may or may not have a bank 2 account , but they'll have a bank 1 account. But my problem is that somehow the dealer didn't come through right for bank 2 and I need to update to the correct value</p>