-- 查询替换:select replace("原始字符串","目标字符串","替换字符串")
select repalce ("hello world","world","mysql");
-- 新建表test02
CREATE table test02 (id int,
title varchar (50),
name varchar (20),
age int,
primary key (id));
-- 查看表test02的表结构
desc test02;
-- 查看表test02的所有数
select * from test02;
-- 将数据插入到test02的表中
insert into test02(title) values ('mysql');
-- 查询替换:select replace(column列表字段,"目标字符串","替换字符串") from 表名;
select replace (title, 'mysql', "test_mysql") as '替换' from test02;
-- 更新替换
update employee set title = replace (title, "TE","TEST");
update test02 set title = replace(title, "test data","test data ing");
-- 插入替换
replace into test02 values (3,"test_replace",'韩寒',31);