当前位置:网站首页>MySQL replacement field part content
MySQL replacement field part content
2022-07-06 12:17:00 【wx5caecf2ed0645】
[mysql]replace Usage of ( Replace part of a field )
[mysql]replace Usage of
1.replace into
replace into table (id,name) values('1','aa'),('2','bb')
The function of this statement is to table table Insert two records . If the primary key id by 1 or 2 Non existence is equivalent to
insert into table (id,name) values('1','aa'),('2','bb')
If the same value exists, no data will be inserted
2.replace(object,search,replace)
hold object It appears that search Replace all of them with replace
select replace('www.163.com','w','Ww')--->WwWwWw.163.com
example : Keep watch table Medium name In the field aa Replace with bb
update table set name=replace(name,'aa','bb')
3.UPDATE Update part of a field
Now the field of a record is “abcdefg", Now I just want to put... In this field c Change it to C,update How should the statement be written
update Table name set Field 1 = replace( Field 1,'c','C')
边栏推荐
- 1081 rational sum (20 points) points add up to total points
- Comparison of solutions of Qualcomm & MTK & Kirin mobile platform USB3.0
- [esp32 learning-1] construction of Arduino esp32 development environment
- 关于Gateway中使用@Controller的问题
- Common properties of location
- . elf . map . list . Hex file
- Rough analysis of map file
- Reno7 60W super flash charging architecture
- Use of lists
- 列表的使用
猜你喜欢
Générateur d'identification distribué basé sur redis
Programmers can make mistakes. Basic pointers and arrays of C language
JS變量類型以及常用類型轉換
Detailed explanation of Union [C language]
JS 函数提升和var变量的声明提升
A possible cause and solution of "stuck" main thread of RT thread
共用体(union)详解【C语言】
记一次云服务器被密码爆破的经历——关小黑屋、改密码、改端口
ES6 grammar summary -- Part 2 (advanced part es6~es11)
MySQL时间、时区、自动填充0的问题
随机推荐
Basic operations of databases and tables ----- modifying data tables
Gateway fails to route according to the service name, and reports an error service unavailable, status=503
Detailed explanation of 5g working principle (explanation & illustration)
Common properties of location
GCC compilation options
@Autowired 和 @Resource 的区别
OSPF message details - LSA overview
level16
锂电池基础知识
Page performance optimization of video scene
基于Redis的分布式ID生成器
Postman 中级使用教程【环境变量、测试脚本、断言、接口文档等】
Time slice polling scheduling of RT thread threads
PT OSC deadlock analysis
ES6 grammar summary -- Part I (basic)
Mysqldump error1066 error solution
js 变量作用域和函数的学习笔记
Pytoch implements simple linear regression demo
RT-Thread API参考手册
程序员老鸟都会搞错的问题 C语言基础 指针和数组