How to UPDATE multiple tables in Microsoft SQL using JOIN query

Sometimes the update query needs to target a complex query and therefore you will need to use this.

SQL Syntax:

UPDATE 

    t1

SET 

    t1.field = value   

FROM 

    t1

    [INNER | LEFT] JOIN t2 ON join_predicate

   ..

WHERE 

    where_predicate;


And MySQL Syntax:

UPDATE t1

[INNER | LEFT JOIN] JOIN t2 ON join_predicate

SET T1.field = value

WHERE condition

Comments

Popular posts from this blog

Enable PHP opcache extension on Windows XAMPP

Sunrose USB Fingerprint Reader Driver

Hiren can not load the CD ROM Driver