达梦数据库(DM7)两表关联更新
UPDATE T1SET T1.FMONEY = (select T2.FMONEY from t2 where T2.FNAME = T1.FNAME)merge into t1using (select t2.fname,t2.fmoney from t2) ton (t.fname = t1.fname)when matched thenupdateset t1.fmoney = t.fmo
·
方式一
UPDATE T1
SET T1.FMONEY = (select T2.FMONEY from t2 where T2.FNAME = T1.FNAME)
方式二
merge into t1
using (select t2.fname,t2.fmoney from t2) t
on (t.fname = t1.fname)
when matched then
update set t1.fmoney = t.fmoney;
更多推荐




所有评论(0)