Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The realization method of replacing letters in mysql database

2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces the realization method of replacing letters in mysql database, which has certain reference value and can be used for reference by friends who need it. I hope you will learn a lot after reading this article. Next, let the editor take you to learn about it.

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

Mysql replacement string

The replace function in mysql directly replaces a specific string in a field in the mysql database, and no longer needs to write its own function to replace it, which 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 watch

Field_name-Field name

From_str-- string to be replaced

To_str-- replaced by a string

For example:

Mysql > UPDATE `dede` SET body = REPLACE (body,',')

This function is multi-byte safe, which means you don't have to worry about Chinese or English characters.

Thank you for reading this article carefully. I hope it will be helpful for everyone to share the method of replacing letters in the mysql database. At the same time, I also hope that you will support us, pay attention to the industry information channel, and find out if you encounter problems. Detailed solutions are waiting for you to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report