Patrick J Okui <[EMAIL PROTECTED]> wrote on 16.07.2002 15:47:50:

>
>I have two collumns in my mysql database like this
>
>+------------------+------------+
>|id                |domain      |
>+------------------+------------+
>|user@domain1com   |domain1.com |
>|[EMAIL PROTECTED] |domain1.com |
>|[EMAIL PROTECTED] |domain1.com |
>+------------------+------------+
>
>in a table users.
>
>How do I construct an sql update statement like
>update users set id =..... where domain = "domain1.com"
>
>so that the id column becomes
>+------------------+
>|id                |
>+------------------+
>|[EMAIL PROTECTED]  |
>|[EMAIL PROTECTED] |
>|[EMAIL PROTECTED] |
>+------------------+
>
>thanks.
>
>Patrick J Okui
>
Hi Patrick,

try UPDATE users SET id=REPLACE(id,'domain1','domain2') WHERE domain='domain1.
com'; 

Bye Oliver
--
Good programming is 40% experience, 30% skill, 20% RTFM, 10% caffeine, and 5% 
attention to detail. 

Oliver Six, CEO
CAHOS GmbH, Cimbernstr. 51, Germany 81377 Muenchen
Phone +49 89 71 01 93 41,  Fax +49 89 71 01 93 42


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