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

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`)

posted @ 2014-09-04 18:21  捕蛇者说  阅读(661)  评论(0编辑  收藏  举报