SELECT SUBSTRING('00012233455',9,3) as A
select concat('123','456')
select concat('0001','9988',SUBSTRING('00012233455',9,3))
select stuff('00019988766',5,4,'1111')
拼接+截取
update tis
set stallId= concat('0001','1708',SUBSTRING(tis.stallId,9,3))
或者
set stallId= '0001'+'1708'+SUBSTRING(tis.stallId,9,3))
FROM t_stall tis
where
stallId like '00012001%'
替换 stuff('字符串',开始位置,替换的长度,'要替换的内容') 要替换的内容为空则为删除
update tis
set stallId= STUFF(tis.stallId, 5, 4, '8810')
FROM t_stall tis
where
stallId like '00019910%'