Inner Join In Update - SQL Query Example

The syntax for the SQL Server UPDATE statement when updating one table with data from another table is,
  1. UPDATE table1 SET table1.column = table2.expression1  
  2. FROM table1 INNER JOIN table2  
  3. ON (table1.column1 = table2.column1)  
  4. [WHERE conditions];  
For example,
  1. UPDATE student  
  2. SET student.first_name = contacts.first_name  
  3. FROM student  
  4. INNER JOIN contacts ON (student.last_name = contacts.last_name)  
  5. WHERE std_id > 20;