日期:2014-05-16  浏览次数:20392 次

mysql 数据库 内容替换
将cdb_pms表subject字段中的Welcom to替换成 欢迎光临

UPDATE `cdb_pms`
SET `subject` = REPLACE(`subject`, 'Welcome to', '欢迎光临')
WHERE INSTR(`subject`,'Welcome to') > 0

替换cdb_posts表的message字段,将“viewthread.php?tid=3989”替换成“viewthread.php?tid=16546”

UPDATE `cdb_posts`
SET `message`= REPLACE(`message`, 'viewthread.php?tid=3989', 'viewthread.php?tid=16546')
WHERE INSTR(`message`,'viewthread.php?tid=3989') > 0 ;

?