Skip to content

Instantly share code, notes, and snippets.

@jaimeivan
Last active April 3, 2018 11:08
Show Gist options
  • Save jaimeivan/0f5364c301ab00d7f66dc757c58edff8 to your computer and use it in GitHub Desktop.
Save jaimeivan/0f5364c301ab00d7f66dc757c58edff8 to your computer and use it in GitHub Desktop.
MySQL

Search for a text string in a field and replace it

UPDATE [table_name]
   SET [field_name] = REPLACE([field_name],'[string_search]','[string_replace]')
 WHERE INSTR([field_name], '[string_search')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment