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)
In HTML, the <img> tag is used to define an...
Error screenshot Can't find where the excepti...
The previous article on Docker mentioned the cons...
Teaching Topics Web page Applicable grade Second ...
1. Spring boot does not support jsp jar package, ...
Official Website https://cli.vuejs.org/en/guide/ ...
1. Install zabbix-agent on web01 Deploy zabbix wa...
This article shares the specific code for JavaScr...
I have been working on a project recently - Budou ...
Table of contents Working principle: What does th...
Result: Implementation Code html <div id="...
Table of contents 01 Introduction to Atomic DDL 0...
1. Create a SpringBooot project and package it in...
Problem description: When phpstorm's SFTP hos...
Let's start with a description of the problem...