方法一
update 更新表 set 字段 = (select 參考數(shù)據(jù) from 參考表 where 更新表.id = 參考表.id)文章來源:http://www.zghlxwxcb.cn/news/detail-693433.html
update a set aaa = (select aaa from b where a.id = b.id),bbb = (select bbb from b where a.id = b.id)
方法二
update 更新表,參考表 set 更新表數(shù)據(jù) = 參考表數(shù)據(jù) where 更新表.id = 參考表.id文章來源地址http://www.zghlxwxcb.cn/news/detail-693433.html
update a,b set a.aaa = b.aaa,a.bbb = b.bbb where a.id = b.id;
到了這里,關(guān)于將一張表的數(shù)據(jù)更新到另外一張表中的文章就介紹完了。如果您還想了解更多內(nèi)容,請?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!