UPDATE `dede` SET body = REPLACE ( body, '', '' );"."/> UPDATE `dede` SET body = REPLACE ( body, '', '' );".">

Home  >  Article  >  Database  >  How to replace letters in mysql

How to replace letters in mysql

藏色散人
藏色散人Original
2020-11-03 10:19:573098browse

In mysql, you can use the replace function to replace letters, and its syntax is such as "mysql> UPDATE `dede` SET body = REPLACE (body, '', '' );".

How to replace letters in mysql

Recommended: "mysql video tutorial"

mysql replacement string

The replace function in mysql directly replaces a specific string in a field in the mysql database. You no longer need to write a function to replace it. It is very convenient to use. mysql replacement function replace()

UPDATE table_name  SET field_name = REPLACE ( field_name , 'from_str', 'to_str' );

Description:

table_name - the name of the table

field_name - the field name

from_str - needs to be replaced String

to_str ——The string replaced by

For example:

mysql> UPDATE `dede` SET body = REPLACE ( body, &#39;</td>&#39;, &#39;&#39; );

This function is multi-byte safe, which means you don’t have to consider whether it is Chinese characters or English characters.

The above is the detailed content of How to replace letters in mysql. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn