Uh, ho trovato
You sometimes run into the problem that you want to replace a substring occuring in a column with a different string, without touching the rest of the string. The solution is surprisingly simple, thanks to MySQL:
UPDATE xoops_bb_posts_text
SET post_text=(
REPLACE (post_text,
'morphix.sourceforge.net',
'www.morphix.org'));
using the string function REPLACE, all items in the post_text column with 'morphix.sourceforge.net' get this substring replaced by 'www.morphix.org'. Ideal when writing a script is just too much effort.![]()

Rispondi quotando