08-07
29

利用sql批处理做SEO优化

dede_archives

id,title,body

要求:
查找title(标题)不以“【”开头的记录。
找到这些记录后,在标题最前面加入【你好北京】

begin
  start transaction;
     update dede_archives set title= concat('【你好北京】',title) where typeid=43 and title not like '【%';

  rollback;
end


继续增加条件
update dede_archives set title= concat('【你好北京】',title) where typeid=15 and id>7890 and title not like '【%';


恢复的SQL:
update dede_archives set title=stuff('title',charindex('【','title'),charindex('】','title'),'')

update dede_archives set title=right(title,len(title)-charindex('】',title))
update dede_archives set title=right(title,length(title)-locate('】',title)) and id=433

[本日志由 blurxx 于 2009-09-04 04:31 PM 编辑]
文章来自: 本站原创
引用通告: 查看所有引用 | 我要引用此文章
Tags: SEO
相关日志:
评论: 0 | 引用: 0 | 查看次数: -
发表评论
昵 称:
密 码: 游客发言不需要密码.
内 容:
验证码: 验证码
选 项:
虽然发表评论不用注册,但是为了保护您的发言权,建议您注册帐号.