今天要将以往的文章加到标签数据库,通过人工一个一个筛选太麻烦,于是就找到了下面的命令。比如你想加文章里含有关键词“温哥华”,就搜索温哥华这个词,将其加入到相应的标签。

INSERT INTO blog_tags SELECT blog_id, 80 FROM blogs WHERE blog_category_id = 1 AND blog_content like ‘%温哥华%’ AND status = ‘P’ AND removed = ‘N’

Advertisements

发表评论

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / 更改 )

Twitter picture

You are commenting using your Twitter account. Log Out / 更改 )

Facebook photo

You are commenting using your Facebook account. Log Out / 更改 )

Google+ photo

You are commenting using your Google+ account. Log Out / 更改 )

Connecting to %s