UPDATE mytable SET email = CONCAT(LEFT(email,LENGTH(email) - 4),".ca")
WHERE RIGHT(email,8) = "test.com";

Something like that?

Regards,
Mike Hillyer
www.vbmysql.com


-----Original Message-----
From: Grant Cooper [mailto:[EMAIL PROTECTED] 
Sent: Sunday, June 01, 2003 2:39 PM
To: [EMAIL PROTECTED]
Subject: updating database query


I'm trying to update an email field. Our company has changed from a .com
to
a .ca. I wrote a php script to make the changes but I was wondering if I
could do this from the command line. Its a text field and I would like
to
replace. [EMAIL PROTECTED] to [EMAIL PROTECTED] Can someone help me out
please.

Thank You


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to