well, #1, I would revision my data model.  since user and domain are 2
distinct pieces of information, I would suggest that you consider pulling
them apart and placing them in separate fields.

#2
update users set is = concat(left(id,position('@',id)),'domain2.com') where
domain = "domain1.com"

or something along those lines.  Check out
http://www.mysql.com/doc/S/t/String_functions.html

=C=
*
* Cal Evans
* The Virtual CIO
* http://www.calevans.com
*


-----Original Message-----
From: Patrick J Okui [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, July 16, 2002 8:48 AM
To: [EMAIL PROTECTED]
Subject: UPDATE command..




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



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



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