Mysql 替换Sql中的正则表达式
我有一个Sql表 表1: ========================================Mysql 替换Sql中的正则表达式,mysql,regex,Mysql,Regex,我有一个Sql表 表1: ======================================== ID Text 1 i am a boy 2 boy!what are you doing? 3 that boy is nice 4 He is a Boy and go to school ID Text 1 i am a Man 2 Man!what are you doing? 3 that M
ID Text
1 i am a boy
2 boy!what are you doing?
3 that boy is nice
4 He is a Boy and go to school
ID Text
1 i am a Man
2 Man!what are you doing?
3 that Man is nice
4 He is a Boy and go to school
========================================
ID Text
1 i am a boy
2 boy!what are you doing?
3 that boy is nice
4 He is a Boy and go to school
ID Text
1 i am a Man
2 Man!what are you doing?
3 that Man is nice
4 He is a Boy and go to school
我想替换单词boy(不区分大小写)。像替补男童到男童然后输出显示
表2:
========================================
ID Text
1 i am a boy
2 boy!what are you doing?
3 that boy is nice
4 He is a Boy and go to school
ID Text
1 i am a Man
2 Man!what are you doing?
3 that Man is nice
4 He is a Boy and go to school
========================================
ID Text
1 i am a boy
2 boy!what are you doing?
3 that boy is nice
4 He is a Boy and go to school
ID Text
1 i am a Man
2 Man!what are you doing?
3 that Man is nice
4 He is a Boy and go to school
要执行此操作,我需要在Sql中编写什么查询您可以使用replace命令进行替换,如下所示:
Update tablename Set Text = replace(Text, 'boy', 'Man');
从
表1
如果这个答案帮助你解决了问题,你应该接受并投票表决。