开发者

Stripping strings from a MySQL field?

开发者 https://www.devze.com 2023-01-15 18:47 出处:网络
Is it possible to run some SQL to change the contents of a field? My field looks like this ..开发者_StackOverflow//uploaded_images/1284058574.jpg

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

精彩评论

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