I don't think you can do it with a single command. One fairly easy way
is to run a command to generate the sql that will do the update. So
your first statement will be something like:

select concat( 'update <mytable> 
set emailaddress=''', emailaddress, 
'''where <primary_key_column>=', 
<primary_key_column)

substituting <mytable> and <primary_key_column> with your values.
Output the results of that query to a file. Use your favorite text
editor to do the actual replacement of the email address domain. Use
mysql to run that file as a sql script. Update complete.

--- Greg Peretti <[EMAIL PROTECTED]> wrote:
> I have what I hope is a simple problem, but being somewhat a novice
> at
> MySQL, it is a bit beyond me.
> 
> 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.
> 
> --
> 
> Greg Peretti
> web developer
> www.abqjournal.com
> (505) 823-3888
> 
> -----------------------------------
> 
> The web of our life is of a mingled yarn, good and ill together.
> -  William Shakespeare
> 
> 
> 
> ---------------------------------------------------------------------
> 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
> 


__________________________________________________
Do You Yahoo!?
Send your FREE holiday greetings online!
http://greetings.yahoo.com

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