Skip to content

Instantly share code, notes, and snippets.

@fjaguero
Created February 18, 2013 12:31
Show Gist options
  • Save fjaguero/4977042 to your computer and use it in GitHub Desktop.
Save fjaguero/4977042 to your computer and use it in GitHub Desktop.
SQL: Replace a string inside a string with LIKE.
UPDATE ps_product_lang
SET ps_product_lang.description
= REPLACE(ps_product_lang.description,'http://server/demo/img/','http://server/img/')
WHERE ps_product_lang.description like '%http://server/demo/img/%';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment