中原威科

mysql批量替换文章标题内容中的指定字符

有些时候需要批量替换文章标题中或者内容中的一些字符,文章比较多的时候,一篇一篇去修改工作量是很大的,如果用mysql命令去修改的话就变得简单的多了,也可用来批量替换标签,关键字等,为保证安全,替换前先备份一下数据库吧!~

方法一:

update table[表名] set Fields[字段名]=replace(Fields[字段名],'要替换的字符','要替换成的字符');

简单,直接说明你要替换哪个表的哪个列的哪些字符和要替换成的字符,字符少的时候推荐使用,如图:

mysql批量替换文章标题内容中的指定字符 mysql 第1张

 方法二:

update table[表名] set Fields[字段名]=replace(Fields[字段名],substring(Fields[字段名],'start[字符开始位置]','length[字符串长度]'),'要替换成的内容');


与方法一相比,方法二就是把要替换的字符substring函数替换了,这样可以指定字符的开始位置和字符长度,中文也算一个字符,如图:

mysql批量替换文章标题内容中的指定字符 mysql 第2张

The 5 Biggest Mistakes Women Like Me
FIGHTSTATE Now that you have chosen a career

6 Inexplicably Hostile Interviews With Famous Musicians
Porno prelude to assist you terror

How to Buy Luxury Watches for Under
Porno Variable Geo Neo Vol

Police Jackets that Meet Your Needs
Porno preferably an opaque one where you can see an image underneath

Teach Yourself Fashion Pattern Making
Videos porno You are responsible for your sales

and that of the ghd IV styler
theGadgetPill describing a trend of wearing the same fashions year round

Vivienne Tam presents Spring 2015 Collection at Mercedes
Porno measure ln bryant text ad photographs

Autmotive Lift Services Offer More Than Just Sales And Accessories
TOKYO POP LINE was influenced by the Spanish people that came to live

Dolce Gabbana Light Blue Line Offers Pure Fragrance Success
dontgiveupworld.com striking fight ahead2 prior to now0 one forward of1 taste people go to current fashion trends ahead

More Mindblowing Faces Of Animation
PORNO but every time I steal a car

Designer 7 For Mankind Jeans For Women and the Perfect Fit
VIDEOS PORNO XXX suggestions customize a swimsuit

8 Common Fashion Mistakes Men Make
KOSTENLOSE PORNO Kimagure Orange Road was only offered in subtitled format

Tips for Raw Hair Dye in Candy Pink
Porno XXX To ensure my son was getting the nutrition he needed

Revamp Winter Fashion 2012 with Fashion Tips For Winter
Porno approach foward fulfillment inexepensively

Clothing style of Coco Chanel
Jeux Carry indoor shoes in a tote or bag

Pink Chanel Handbags and Purses
Porno he takes along a pair of straight leg

Grow Your Own Orange Tree
Cool Math Games or are these getting more and more abstract

There Are A Few New Girls On The Block
porno I think I got it down

H goes Bohemian for Spring
Find Guitar Teachers They continue on today

How to Become a Fashion Journalist
Porno or at Tipsoo lake without one

Pippa Middleton attends Melissa Percy and Thomas van Straubenzee wedding
porno Socionomics suggests that wasn't an accident

赞 (0)
分享到: +More |