开发者

Stripping strings from a MySQL field?

Is it possible to run some SQL to change the contents of a field?

My field looks like this

..开发者_StackOverflow//uploaded_images/1284058574.jpg

and I want it to simply be

1284058574.jpg

all the records that I wish to change will start with

..//uploaded_images/


if it's already in the database you could do a find and replace?

update TABLE_NAME set FIELD_NAME = replace(FIELD_NAME, '..//uploaded_images/', '(REPLACE TEXT LEAVE EMPTY)');

you may or may not have to character escape the slashes, I'm not sure on that one

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜