日期:2014-05-17 浏览次数:20542 次
select number from
spt_values with(nolock)
where type='P'
declare @num1 int
set @num1=10 --初始值
declare @num2 int
set @num2=50 --结束值
select number from
spt_values with(nolock)
where type='P' and number between @num1 and @num2
--结果
number
-----------
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
(41 行受影响)