update A set name=(select name from B whre A.id=B.id)
多列的话同理,往后加就行了
﹌傲似。表情帝╯▽╰
2025-03-30 05:25:25
例如 表A、B有相同的字段col1,col2: update A t1 set (t1.col1,t1.col2)=(select t2.col1,t2.col2 from B t2 where t1.id=t2.id) 还可以给A加上条件: update A t1 set (t1.col1,t1.col2)=(select t2.col1,t2.col2 from B t2 where t1.id=t2.id) where A.id is not null