Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ThijsFeryn/649447302a88acd1f3844d3fb4773701 to your computer and use it in GitHub Desktop.
Save ThijsFeryn/649447302a88acd1f3844d3fb4773701 to your computer and use it in GitHub Desktop.
Update statement that does a find and replace based on the last occurrence of a string
UPDATE `table` SET `somefield` = CONCAT(TRIM(TRAILING 'feryn.eu' FROM `name`),'thijs.be') WHERE 'otherField' = 'value'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment