update abc set abc=replace(abc,'|||','') --去掉abc字段中所有 ||| update abc set abc=stuff(abc,1,3,'') where abc like '|||%' --去掉前字段前三个含有|||的字符
-->>测试数据 if object_id('tbc') is not null drop table [tbc] create table [abc] (abc varchar(15)) insert [abc] (abc) values('||| a') insert [abc](abc) values('||| b') -->>查询表 select * from abc -->>字段abc处理 select right(abc,1) as 'abc'from [abc] select replace(abc,'|||','') as 'abc' from [abc] -->>查询结果 /*abc a b */
-->>测试数据 if object_id('tbc') is not null drop table [tbc] create table [abc] (abc varchar(15)) insert [abc] (abc) values('||| a') insert [abc](abc) values('||| b') -->>查询表 select * from abc -->>字段abc处理 select right(abc,1) as 'abc'from [abc] select replace(abc,'|||','') as 'abc' from [abc] -->>update字段处理 update [abc] set abc=right(abc,1) -->>查询结果 /*abc a b */
update abc update 表名 set 字段名 = replace(字段名,'|','')
set abc=replace(abc,'|||','')
set abc = replace(abc,'|||','')
update abc set abc=stuff(abc,1,3,'') where abc like '|||%' --去掉前字段前三个含有|||的字符
if object_id('tbc') is not null
drop table [tbc]
create table [abc] (abc varchar(15))
insert [abc] (abc) values('||| a')
insert [abc](abc) values('||| b')
-->>查询表
select * from abc
-->>字段abc处理
select right(abc,1) as 'abc'from [abc]
select replace(abc,'|||','') as 'abc' from [abc]
-->>查询结果
/*abc
a
b
*/
if object_id('tbc') is not null
drop table [tbc]
create table [abc] (abc varchar(15))
insert [abc] (abc) values('||| a')
insert [abc](abc) values('||| b')
-->>查询表
select * from abc
-->>字段abc处理
select right(abc,1) as 'abc'from [abc]
select replace(abc,'|||','') as 'abc' from [abc]
-->>update字段处理
update [abc] set abc=right(abc,1)
-->>查询结果
/*abc
a
b
*/
update 表名 set 字段名 = replace(字段名,'|','')