Tuesday, April 14, 2015

Update one table based on another table using JOIN - SQL Server

Example

  UPDATE t1 SET   
     t1.status = 1  
  FROM  table1 t1   
     INNER JOIN table t2   
           ON t1.Id = t2.ID  
  WHERE t2.num = 15   

No comments:

Post a Comment