Posts

Showing posts from 2021

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