select top 12 month=identity(int,1,1) into #t from sysobjects
select * from #t
?? http://topic.csdn.net/u/20090906/17/a91cd31e-abf7-4190-8486-c5491aa63c71.html?seed=1380177511&r=59598572#r_59598572 SELECT * from ( SELECT 1 AS 'MONTH' UNION ALL SELECT 2 UNION ALL SELECT 3 UNION ALL SELECT 4 UNION ALL SELECT 5 UNION ALL SELECT 6 UNION ALL SELECT 7 UNION ALL SELECT 8 UNION ALL SELECT 9 UNION ALL SELECT 10 UNION ALL SELECT 11 UNION ALL SELECT 12 ) T 樓上正解 我喜欢一楼的答案,,能否解释一下原因。。 MASTER..SPT_VALUES 是系统表
SQL code:
select number from MASTER..SPT_VALUES where type='p' ---你执行一下这个,就知道了