Posted By

ed_trench on 10/04/12


Tagged

sql update joins


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

daK76


SQL UPDATE using JOIN


 / Published in: SQL
 

SQL update examples using joins

  1. UPDATE c
  2. SET ContactId = ac.contact_id
  3. FROM ATable AS c
  4. INNER JOIN BTable AS ac ON c.Contact = (ac.surname + ', ' + ac.forename)
  5.  
  6. UPDATE c
  7. SET AreaCoordinator = cha.ContactId
  8. FROM dbo.ATable AS c
  9. INNER JOIN dbo.BTable AS cha ON c.County = cha.County

Report this snippet  

You need to login to post a comment.