update query sql with join code example
Example 1: update with join sql server
UPDATE
t1
SET
t1.c1 = t2.c2,
t1.c2 = expression,
...
FROM
t1
[INNER | LEFT] JOIN t2 ON join_predicate
WHERE
where_predicate;
Example 2: joins in update query
update a
join b
on a.a_id=b.b_id
set b.is_active = 1
where ....;