Page 1 of 1

Sql script to delete section of text?

Posted: Mon May 25, 2009 10:33 am
by richandfruity
Hi everyone

I am hoping someone could help. My website uses a database which via a feed from an external database (which I do not have access to) updates every day and includes image URLS.

The problem I have is the feed inputs the image url like

Code: Select all

http://www.mysite.com/images/imagespicture1.jpg
What I need to be able to run is a SQl script that gets rid of the word images before the picture name. In the example above the result would be

Code: Select all

http://www.mysite.com/images/picture1.jpg
I have looked at UPDATE statements but haven't been able to figure out a way of truncating just that part of the URL.

If anyone could help that would be jolly marvellous!

Regards
peter

Re: Sql script to delete section of text?

Posted: Fri May 29, 2009 1:29 pm
by andyhoneycutt
you should take a look at the mysql replace function.

-Andy