Skip to content

Instantly share code, notes, and snippets.

@matthewsimo
Created August 22, 2012 05:28
Show Gist options
  • Select an option

  • Save matthewsimo/3422501 to your computer and use it in GitHub Desktop.

Select an option

Save matthewsimo/3422501 to your computer and use it in GitHub Desktop.
SQL Query to find 'search-term-find' & replace with 'search-term-replace' in a colX in tableX if colY matches colYvalue in same row.
UPDATE tableX
SET tableX.`colX` = REPLACE(colX,'search-term-find','search-term-replace')
WHERE tableX.`colY` = 'colYvalue';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment