Batch replace part of the data of a field in MYSQL, the specific introduction is as follows: 1. Modify all text in the field containing the specified string UPDATE tableA SET fieldB = replace(fieldB, 'aaa', 'bbb') example: update table set url= replace(url, 'aaa', 'bbb') [Batch change aaa in the url field to bbb] update table set url= REPLACE (url,'3','1.png') where condition; 2. Modification of general conditions: update table set column='' where column is null Column: update `table` set `url`='0' where `url` is null Knowledge point supplement: MySQL batch replaces part of the content of a field Example There is a data table person, the structure is as follows
Requirement: Replace the xh in the urls field with the value of the id field Statement: UPDATE person SET urls = (REPLACE(urls,'xh',id)); Execution Result:
Summarize This is the end of this article about batch replacing part of the data in a field in MySQL. For more relevant MySQL batch replacement field content, please search 123WORDPRESS.COM's previous articles or continue to browse the following related articles. I hope everyone will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: Vue Getting Started with Weather Forecast
>>: Ubuntu 20.04 Best Configuration Guide (Newbie Essential)
This article records the installation tutorial of...
Table of contents K8S Advanced Features Advanced ...
As shown below: select a1,a2,a1+a2 a,a1*a2 b,a1*1...
Table of contents 1. Introduction 2. Code Impleme...
Preface Sometimes, we need a floating effect requ...
There is a task process on the server. When we us...
From development to deployment, do it yourself Wh...
The road ahead is long and arduous, but I will co...
Recorded the download and installation tutorial o...
Isolation of process address spaces is a notable ...
Original link: https://vien.tech/article/157 Pref...
This article mainly introduces an example of how ...
Placing a search box in the top menu bar is a com...
This article describes how to install php7 + ngin...
Contemporary web visual design has gone through th...