Tips And Tricks On MySql

1. Find and replace string in a column. This is the safest way to test your live data on your localhost to change the realemail address to bogus one. For example, you have a table of “members” with “email” field.

UPDATE
members
SET
email = CONCAT( SUBSTRING(email, 1,LOCATE('@', email)), 'mailcatch.com')

Tags:

Speak Your Mind

Tell us what you're thinking...
and oh, if you want a pic to show with your comment, go get a gravatar!

You must be logged in to post a comment.