On 20-Jun-2003 Craig Harding wrote:
<snip>
> 'url' has about 20 rows starting with 'disciplines/someurl' and I want
> to replace 'disciplines' with 'programs'. Is there a way to do this in
> mysql? I know I can do it in php, but it would be cool to do it, (and
> probably faster) to do it in mysql.
>
> I know how do use the regexp for SEARCHING, but can I do a replace on
> the same cmd with an UPDATE?
>
UPDATE foo SET url=REPLACE(url, 'disciplines/', 'programs/')
WHERE url LIKE 'disciplines/%';
Regards,
--
Don Read [EMAIL PROTECTED]
-- It's always darkest before the dawn. So if you are going to
steal the neighbor's newspaper, that's the time to do it.
(53kr33t w0rdz: sql table query)
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]