Updating a table with a condition based on the second table through JOIN MSSQL
Example of updating data in one table with simultaneous comparison and condition check based on the second table using JOIN:
update cc
set cc.ActivateState=2
from ClientsCards cc
left join ClientsCardsHeads cch
on cch.CardUid=cc.Uid
where cc.ActivateState=0 and cch.State=3
ClientsCards cc - The first table where the change is made.
ClientsCardsHeads cch - The second table with data that is being compared.
Comments (0)
No comments yet.