2006/3/19, Adam i Agnieszka GÄ…siorowski FNORD <[EMAIL PROTECTED]>: > > On 2006-03-18, at 00:59, Yani Copas wrote: > > > > > Is there a quick and dirty way to update such that I can only > > affect the portion > > of a string (varchar column) that matches a regexp? > > (e.g. replace all '%20' with ' ' leaving the rest untouched?) > > You know that proverb - "For a man in possession of a hammer, > everything looks like a nail". > Don't do that. MySQL is *really slow* with Regular Expressions. It > will be much easier to SELECT > all records you want to change, storing their IDs in a list (or > array) construct, then tell your favourite > script program to construct an REPLACE query out of these chosen > few, after it does whatever you want it to do > with the records' data.
Yeah, but sometimes beoing able to do such things on the mysql command line would be very helpful ! (Instead of having a script for such simple things which would be like having a jack hammer for a nail.. ) -- Pooly Webzine Rock : http://www.w-fenec.org/