컴퓨터/개발

자기 테이블을 참조하여 업데이트 update self table inner join

하늘치 2017. 7. 24. 15:31
반응형

UPDATE g5_shop_item_last AS t1 

JOIN (SELECT it_id, it_explan FROM g5_shop_item_last) AS t2

USING (it_explan)

SET t1.it_mobile_explan = t2.it_explan;






----- by Using Set Based Approch
Update
[dbo].[EmployeeMaster]
set [EmpSalary]= am.AppraisedSalary
from
[dbo].[EmployeeMaster] em
inner join
[dbo].[AppraisedEmployee] am
on em.EmpId = am.EmpId





반응형