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
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
解决方案 »
- 继续请教“中国风”大侠
- SQL2000中,看看这个商品分类的SQL怎么写?
- 如何查询两个时间段所差别的小时
- group by a,b,c和group by b,c,a 的区别?
- 可以在存贮过程中定义一个变量存放临时表吗?
- 用户 '(null)' 登录失败。原因: 未与信任 SQL Server 连接相关联。
- csv文件导入sql server的表中
- 刚装DB2,不知道怎么建立一个数据库,请教?
- 请教一个系统报错
- 錯誤代碼:0x80040E4D,錯誤信息:使用者登入失敗.(ASP中出現此錯誤,VB中是可以的),急!!
- SQL语句问题:如何实现把另一个表中符合某个条件的结果集的某个字段显示在一条记录中?
- 连接数据库时出现的问题
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*/