请教updata,谢谢
数据库的数据
字段1 字段2
a 0
a 0
a 0
a 0
a 0
更新后的结果为
字段1 字段2
a 10
a 5
a 5
a 5
a 5
[解决办法]
什么规律?
[解决办法]
select id = identity(int,1,1) , * into b from a
update b
set 字段2 = 10 where id = 1
update b
set 字段2 = 5 where id <> 1
delete from a
insert into a(字段1,字段2) select 字段1,字段2 from b
drop table b
[解决办法]
:)