关注LAMP|PHP源代码分析|web架构|PHP扩展|Erlang|服务端架构

跨表更新字段

2008-11-19

原创文章,转载请注明: 转载自庆亮的博客-webgame架构

本文链接地址: 跨表更新字段

语法 update table1, table2 set filed = value where condition
想使用一下WP,发现它的rss方式无法正常导入boblog的日志,只好自己sql导入.一开始没有注意到要加入第二个到update 表列表中, 如下:
 

update wp_posts set wp_posts.`post_content` =  boblog_blogs.content 

where wp_posts.`post_title` = boblog_blogs.`title`  

查了手册,修改一下,简单解决.

update wp_posts, boblog_blogs set wp_posts.`post_content` =  boblog_blogs.content 

where wp_posts.`post_title` = boblog_blogs.`title`

作者:庆亮 | 分类目录:Mysql | 标签:

发表评论

电子邮件地址不会被公开。 必填项已用 * 标注

*

您可以使用这些 HTML 标签和属性: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>