日期:2014-05-19  浏览次数:20573 次

怎么用T-SQL 产生1到100的数列
不用存储过程   和   函数   就只用select   能够做到吗   ?(环境是sql   server   2005)

------解决方案--------------------
Select
a + b * 10 + 1
From
(Select 0 As a
Union
Select 1
Union
Select 2
Union
Select 3
Union
Select 4
Union
Select 5
Union
Select 6
Union
Select 7
Union
Select 8
Union
Select 9) A,
(Select 0 As b
Union
Select 1
Union
Select 2
Union
Select 3
Union
Select 4
Union
Select 5
Union
Select 6
Union
Select 7
Union
Select 8
Union
Select 9) B
Order By
a + b * 10 + 1