sql语句把字段中的某个字符去掉
Posted 叶长种-.Net软件工程师
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sql语句把字段中的某个字符去掉相关的知识,希望对你有一定的参考价值。
sql语句把字段中的某个字符去掉
update Notifications set Accessory=replace(Cast(Accessory as varchar(8000)),‘http://demo.m-school.net‘,‘‘)
例如:
update Notifications set Accessory=replace(Cast(Accessory as varchar(8000)),‘http://192.168.2.180‘,‘‘) update Notifications set Accessory=replace(Cast(Accessory as varchar(8000)),‘http://zpzx.m-school.net‘,‘‘) update Homeworks set Accessory=replace(Cast(Accessory as varchar(8000)),‘http://192.168.2.180‘,‘‘) update Homeworks set Accessory=replace(Cast(Accessory as varchar(8000)),‘http://zpzx.m-school.net‘,‘‘) update OpenCourses set Attachment=replace(Cast(Attachment as varchar(8000)),‘http://192.168.2.180‘,‘‘) update OpenCourses set Attachment=replace(Cast(Attachment as varchar(8000)),‘http://zpzx.m-school.net‘,‘‘) update OpenCourses set Audio=replace(Cast(Audio as varchar(8000)),‘http://192.168.2.180‘,‘‘) update OpenCourses set Audio=replace(Cast(Audio as varchar(8000)),‘http://zpzx.m-school.net‘,‘‘) update ListenCourses set Attachment=replace(Cast(Attachment as varchar(8000)),‘http://192.168.2.180‘,‘‘) update ListenCourses set Attachment=replace(Cast(Attachment as varchar(8000)),‘http://zpzx.m-school.net‘,‘‘) update ListenCourses set Audio=replace(Cast(Audio as varchar(8000)),‘http://192.168.2.180‘,‘‘) update ListenCourses set Audio=replace(Cast(Audio as varchar(8000)),‘http://zpzx.m-school.net‘,‘‘)
老师,学生,家长头像:
update Sys_User set Portrait=replace(Portrait,‘http://zpzx.m-school.net‘,‘‘) update Students set Portrait=replace(Portrait,‘http://zpzx.m-school.net‘,‘‘) update Parents set Portrait=replace(Portrait,‘http://zpzx.m-school.net‘,‘‘)
以上是关于sql语句把字段中的某个字符去掉的主要内容,如果未能解决你的问题,请参考以下文章