mysql:把DB1中A表a字段替换为DB2中B表b字段

时间:2022-10-28 08:55:33

UPDATE DB1.A SET a = ( SELECT b FROM DB2.B WHERE B.Id = A.id)

实例:

UPDATE wordpress.`wp_posts` SET post_content = ( SELECT `内容` FROM test.`content` WHERE content.Id = wp_posts.`ID`)