On 2006-03-20, at 12:11, Pooly wrote:

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.. )

        Oh, in that case use a subselect syntax - inner one would SELECT
FROM using REGEX syntax (use the fine manual, it's described in detail)
 for the outer one, wytch would create an UPDATE statement (SQL) using
data from the inner one. Oh, add outermost one executing that statement,
 if you wish or simply copypaste the result of the previous cascade.




--
Seks, seksić, seksolatki...<uri: news:pl.soc.seks.moderowana >
Siúil, siúil, siúil A rúin...Siúil go sochair agus siúil go ciúin! Siúil go doras agus éalaigh liom! Is go dté tú mo mhúirnín slán...
https://hyperreal.info | https://kanaba.info |=> "Szanuj Zieleń!"



Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to