当前位置:网站首页>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')
边栏推荐
猜你喜欢
Redis based distributed locks and ultra detailed improvement ideas
(五)R语言入门生物信息学——ORF和序列分析
Detailed explanation of 5g working principle (explanation & illustration)
小天才电话手表 Z3工作原理
C language callback function [C language]
js题目:输入数组,最大的与第一个元素交换,最小的与最后一个元素交换,输出数组。
Redis 缓存更新策略,缓存穿透、雪崩、击穿问题
Togglebutton realizes the effect of switching lights
JS Title: input array, exchange the largest with the first element, exchange the smallest with the last element, and output array.
Arduino uno R3 register writing method (1) -- pin level state change
随机推荐
Types de variables JS et transformations de type communes
Kaggle competition two Sigma connect: rental listing inquiries (xgboost)
高通&MTK&麒麟 手机平台USB3.0方案对比
Bubble sort [C language]
Symbolic representation of functions in deep learning papers
Raspberry pie tap switch button to use
Imgcat usage experience
Mysql database interview questions
Kaggle competition two Sigma connect: rental listing inquiries
Mp3mini playback module Arduino < dfrobotdfplayermini H> function explanation
Comparison of solutions of Qualcomm & MTK & Kirin mobile platform USB3.0
(一)R语言入门指南——数据分析的第一步
A possible cause and solution of "stuck" main thread of RT thread
arduino UNO R3的寄存器写法(1)-----引脚电平状态变化
Basic operations of databases and tables ----- view data tables
记一次云服务器被密码爆破的经历——关小黑屋、改密码、改端口
Gateway 根据服务名路由失败,报错 Service Unavailable, status=503
Learning notes of JS variable scope and function
Missing value filling in data analysis (focus on multiple interpolation method, miseforest)
Basic operations of databases and tables ----- modifying data tables