MySql Replace word by SQL Query

This item was filled under [ Tips ]

Do you know that You CAN replace MySql field values by SQL query? it’s pretty simple. Use update Command with “replace” to set value to field:

UPDATE table_name SET table_field = REPLACE(table_field,'replace_string','with_this_string');

Not only this, you can do whole lot of other things without having to write any programes (php, asp etc) to do some trick with MySql DB contents

Have a look: http://dev.mysql.com/doc/refman/5.0/en/string-functions.html (MySql 5+)

Tagged with: [ , , , , ]
You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

Leave a Comment