方法1demo是将class_name赋值为 company UPDATE work w SET w.class_name = ( SELECT a.company FROM ( SELECT * FROM work ) a WHERE a.id = w.id ) 方法2update table_1 t1,table_2 t2 set t1.column = t2.column where t1.id = t2.pid; 方法3update B, A set B.username = A.username, B.phone = A.phone where B.userId = A.userId 方法4update B join A on B.userId=A.userId set B.username = A.username, B.phone = A.phone |