如果我想在SQL里面的某一字段的空挡处插入同一个字符 其语句是什么?

2025-12-05 19:31:07
推荐回答(3个)
回答1:

update 表 set 字段1=replace(字段1,' ',' *') where 条件

把字段1空格替换成空格*号 即在空格后插入*

回答2:

declare @x nvarchar(100)
set @x='dfsfdsf dfsaaf'
select replace(@x,' ','*')
--把空格替换成*号

回答3:

select 'a' + a as a
from b