declare @t table([id] int IDENTITY(1,1),[money] dec(18,2))
insert into @t select 1
insert into @t select 12
insert into @t select 134
insert into @t select 56
insert into @t select 534
insert into @t select 33
insert into @t select 0
insert into @t select 45
insert into @t select 5654
insert into @t select 66
insert into @t select 545
insert into @t select 6
insert into @t select 144
insert into @t select 442
insert into @t select 4
insert into @t select 44
update @t set [money]=[money]+1 where id>=1 and id<=20select * from @t

解决方案 »

  1.   

    --多写点数据
    declare @t table([id] int IDENTITY(1,1),[money] dec(18,2))
    insert into @t select 1
    insert into @t select 12
    insert into @t select 134
    insert into @t select 56
    insert into @t select 534
    insert into @t select 33
    insert into @t select 0
    insert into @t select 45
    insert into @t select 5654
    insert into @t select 66
    insert into @t select 545
    insert into @t select 6
    insert into @t select 144
    insert into @t select 442
    insert into @t select 4
    insert into @t select 44
    insert into @t select 1
    insert into @t select 12
    insert into @t select 134
    insert into @t select 56
    insert into @t select 534
    insert into @t select 33
    insert into @t select 0
    insert into @t select 45
    insert into @t select 5654
    insert into @t select 66
    insert into @t select 545
    insert into @t select 6
    insert into @t select 144
    insert into @t select 442
    insert into @t select 4
    insert into @t select 44
    update @t set [money]=[money]+1 where id>=1 and id<=20select * from @t/*
    id          money                
    ----------- -------------------- 
    1           2.00
    2           13.00
    3           135.00
    4           57.00
    5           535.00
    6           34.00
    7           1.00
    8           46.00
    9           5655.00
    10          67.00
    11          546.00
    12          7.00
    13          145.00
    14          443.00
    15          5.00
    16          45.00
    17          2.00
    18          13.00
    19          135.00
    20          57.00
    21          534.00
    22          33.00
    23          .00
    24          45.00
    25          5654.00
    26          66.00
    27          545.00
    28          6.00
    29          144.00
    30          442.00
    31          4.00
    32          44.00*/