|
发表于 2020-1-4 16:09:01
|
显示全部楼层
create table T(A varchar(10), B int, C int)
insert T select 'a' , 1, 2
union all select 'b' , 2, 3
union all select 'c' , 3, 4
union all select '1d', 5, 6
union all select '1e', 6, 7
union all select '1f', 8, 9
update T set A='1'+A
where charindex('1', A)<>1
select * from T
--result
A B C
---------- ----------- -----------
1a 1 2
1b 2 3
1c 3 4
1d 5 6
1e 6 7
1f 8 9
(6 row(s) affected) |
|