In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
Most people do not understand the knowledge points of this article "how to replace replace in mysql", so the editor summarizes the following content, detailed content, clear steps, and has a certain reference value. I hope you can get something after reading this article. Let's take a look at this "how to replace replace in mysql" article.
In mysql, the replace function, when used in conjunction with the SELECT statement, can be used to perform string substitution operations, while also supporting multiple strings to be replaced at the same time, with the syntax "SELECT REPLACE (column name of the database table, string to be replaced, string to be replaced)".
The operating environment of this tutorial: windows10 system, mysql8.0.22 version, Dell G3 computer.
How to use replace replacement in mysql
Grammar
Replace (field,search,replace)
Description:
Field-column name of the database table
Search-string to be replaced
Replace-replaced by a string
Semantics: replace all search strings that appear in the column name: field with replace strings.
Mysql replace instance description:
UPDATE tb1 SET f1=REPLACE (F1, 'abc',' def')
Explanation: the value of abc in field F1 in table tb1 is updated to def. It is generally used for a field where the value in a field is inappropriate. You need to change it in batches. You can use update table set field = replace ('field', 'some value of the field', 'value to be replaced')
REPLACE (str,from_str,to_str)
All occurrences of the string from_str in the string str are replaced by to_str, and this string is returned.
The substitution function REPLACE in MySQL replaces all strings S1 in the string s with the string S2.
[example] use the REPLACE function to replace the string. The input SQL statement and execution process are as follows.
Mysql > SELECT REPLACE ('aaa.mysql.com','a','w') +-- + | REPLACE ('aaa.mysql.com','a' 'w') | +-+ | www.mysql.com | +-+ 1 row in set (0.00 sec)
As you can see from the running result, using REPLACE ('aaa.mysql.com','a','w') to replace the "a" character of the "aaa.mysql.com" string with the "w" character, the result is "www.mysql.com".
The above is about the content of this article on "how to use replace replacement in mysql". I believe we all have a certain understanding. I hope the content shared by the editor will be helpful to you. If you want to know more about the relevant knowledge, please follow the industry information channel.
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.