Skip to content

Instantly share code, notes, and snippets.

@betawax
Created October 15, 2015 07:17
Show Gist options
  • Save betawax/4ab5518ac1e98732b622 to your computer and use it in GitHub Desktop.
Save betawax/4ab5518ac1e98732b622 to your computer and use it in GitHub Desktop.
MySQL search & replace
UPDATE [TABLE] SET [FIELD] = REPLACE([FIELD], 'foo', 'bar') WHERE INSTR([FIELD], 'foo') > 0;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment