30 September 2023

To perform a string replacement (or substring replacement) in MySQL, you can use the REPLACE function. This function allows you to search for a specified substring within a string and replace it with another substring.

Source code viewer
  1. UPDATE products
  2. SET value = REPLACE(value, 'from', 'to')
  3. WHERE id = 123;
Programming Language: MySQL