[thelist] mysql-changing some but not all info in a column
Katherine Spice
thelist at lists.evolt.org
Mon Sep 9 08:19:00 2002
Hi Adrian,
> http:/domain.com/images/nicepic.gif
>
> becomes
>
> http://newdomain.com.au/blah/blah
Try this - add a new column to the table (newdomaincolumn) and then run
update tablename set
newdomaincolumn=CONCAT("http://newdomain.com.au",SUBSTRING(olddomaincolumn,16));
where 16 is the number or characters in http:/domain.com. Then you can
drop olddomaincolumn and rename newdomaincolumn as the old one.
HTH,
Katherine