Replace a specific word with new in a column of table in MySQL

Created at 03-Aug-2022 , By samar

Replace a specific word with new in a column of table in MySQL

In this session, we are going to try to solve the "Replace a specific word with new in a column of table in MySQL" puzzle by using the computer language.

How can i replace a specific word with a new word in a column of MySQL table. We have a column and i want to change some text with new text after executing a single query. How can i do it.
  • UPDATE codesnippets SET code_snippet = REPLACE(code_snippet, '<pre class="language-javascript">','<pre class="language-php">');
    

    Here we have a codesnippets table with column name code_snippet and we have updated the string <pre class="language-javascript"> with <pre class="language-php"> in the code_snippet column.

Back to code snippet queries related sql

If you like what you are reading, please consider buying us a coffee ( or 2 ) as a token of appreciation.

Buy Me A Coffee

Don't forget to share this article! Help us spread the word by clicking the share button below.

We appreciate your support and are committed to providing you valuable and informative content.

We are thankful for your never ending support.