原数据库(库名为media)中id=46111的数据,字段内容如下:

一:在post_type字段内容前追加数字’4′
UPDATE media SET post_type=CONCAT('4',post_type) WHERE id=46111
结果如下:

二:在post_type字段内容后追加数字’3′
UPDATE media SET post_type=CONCAT(post_type,'3') WHERE id=46111
结果如下:

三:在post_type字段内容后增加多条追加数字’3′
UPDATE media SET post_type=CONCAT(post_type,'3') WHERE id in(46111,46112,46115,46118)
说明:media是表名,post_type是表内字段,id的定位条件用来决定你的数据插入哪行。批量指定定位多条数据,参考三
评论前必须登录!
注册