Skip to content

Instantly share code, notes, and snippets.

@grim-reapper
Forked from AndrewChamp/find.and.replace.sql
Created November 17, 2022 12:34
Show Gist options
  • Save grim-reapper/45f47e78e1fa9f60302499cb92f2aa4f to your computer and use it in GitHub Desktop.
Save grim-reapper/45f47e78e1fa9f60302499cb92f2aa4f to your computer and use it in GitHub Desktop.
MySQL Find & Replace
UPDATE TABLE_NAME
SET COLUMN_NAME = REPLACE(COLUMN_NAME, 'string/to/find', 'string/to/replace')
# OPTIONAL: Replaces embedded strings
WHERE COLUMN_NAME LIKE ('%string_to_find%');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment