Greg Peretti writes:

> I have a database that has a emailaddress field. A large number of the
> entries are from home.com, Excite's ISP. Since Excite is out of
> business, Comcast is converting them all to comcast.net next month.
> 
> Is there a simple way to change all home.coms to comcast.nets while
> retaining the front part of each email address in our database?
> 
> A link to the pertinent section of the manual would be most helpful.

String functions: http://www.mysql.com/doc/S/t/String_functions.html
Something like this should work:

UPDATE t1 SET email = CONCAT(SUBSTRING_INDEX(email, '@', 1),
   '@comcat.net') WHERE email LIKE '[EMAIL PROTECTED]'

//C

-- 
 Carl Troein - Círdan / Istari-PixelMagic - UIN 16353280
 [EMAIL PROTECTED] | http://pixelmagic.dyndns.org/~cirdan/
 Amiga user since '89, and damned proud of it too.


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to