Sql批量替换字段字符,Sql批量替换多字段字符,Sql替换字符
update phome_ecms_news_check set filename= replace(filename,'Under4-','');
update phome_ecms_news_check set title= replace(title,'Under4 ','');
update phome_ecms_news_check set keyboard= replace(keyboard,'Under4','');
update phome_ecms_news_check set smalltext= replace(smalltext,'Underr4','');
update phome_ecms_news_check_data set newstext= replace(newstext,'Under','');
update phome_ecms_news_check set title= replace(filename,'supply','xxx');
update phome_ecms_news_check set title= replace(filename,'Supply','xxx');
update phome_ecms_news_check_data set newstext= replace(newstext,'supply','');
update phome_ecms_news_check_data set newstext= replace(newstext,'Supply','');
方法一:
update 表名 set 字段名=replace(cast(与前面一样的字段名 as varchar(8000)) ,'原本内容','想要替换成什么')
方法二:
update [表名] set 字段名 = replace(与前面一样的字段名,'原本内容','想要替换成什么')
update [表名] set 字段名 = replace (与前面一样的字段名, '原本内容' , '想要替换成什么' )
|