update `tblapplicationcom`
set ApplicationDate= (
select ApplicationDate
from tblimportapplication)
where tblapplicationcom.ApplicationID in (
select Applicationid
from tblimportapplication
where tblimportapplication.Applicationid = tblapplicationcom.ApplicationID)
我一直在尝试这个代码,但不能很好。
我想要的是什么
表#1
Applicationid(pk)
ApplciationDate
表#2
RecordID(pk)
ApplicationID(FK)
ApplicationDate
我想从表#1的ApplicationDate更新表#2的ApplicationDate,其中table2.applicationid = table1.applicationid
答案 0 :(得分:0)
以下是需要使用其他表中的值进行更新时的语法:
update tblapplicationcom a
join tblimportapplication b on a.Applicationid = b.ApplicationID
set a.ApplicationDate = b.ApplicationDate;