...

View Full Version : Need query to part change data in each row.



treetops
11-23-2011, 10:47 AM
Hello
I have a MySQL table with around 20,000 rows.
One of the fields in each row contains url data. I need to change only part of the url from each row, leaving the rest intact. Is it possible to do?

e.g.
all rows currently: http://www.xxx.uniqueID.com

now need to be: http://www.zzz.uniqueID.com

Many thanks for any help, it's appreciated.

Tree

treetops
11-23-2011, 11:46 AM
Just to let you know, I found what I needed -

update [table_name] set [field_name] = replace([field_name],'[string_to_find]','[string_to_replace]');

thanks anyway

guelphdad
11-23-2011, 01:57 PM
rather simple right? :)
Thanks for taking the time to post your solution, it will help others who come across your thread that are having problems solving in a similar situation.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum