Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

How to use the replace function in mysql

Shulou Source: shulou.com Published: 2022-05-31 10:42:47 09月23日 Update

This article mainly explains "how to use the replace function in mysql". The content in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "how to use the replace function in mysql".

Description

1, you can replace the contents of the string, directly replace a specific string in a field in the database, no longer need to write their own function to replace.

It is a common function in mysql to deal with strings.

2. It is used to replace all from_str in the string str with to_str, and return the replaced string.

Example

SELECT REPLACE ('MySQL string function', 'string', 'date') AS str1, REPLACE ('MySQL string function', 'string',') AS str2 Str1 | str2 |-+-+ MySQL date function | MySQL function | Thank you for reading. The above is the content of "how to use the replace function in mysql". After the study of this article, I believe you have a deeper understanding of how to use the replace function in mysql, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Tags: Functions characters strings content learning dates fields examples that is commonly used ideas situations data databases articles more knowledge knowledge points articles follow Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno NVidia macOS Xiaomi Docker Linux