求一句SQL语句 求一句SQL语句,能够生成1列31行的数据,列为1到31的序号也就是生成如下形式序号123...中间省略...3031 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 --用临时表select top 31 identity(int,1,1) as IDinto #tpfrom syscolumns c1,syscolumns c2 select * from #tpdrop table #tp select top 31 identity(int,1,1)TID into #t from sysobjectsselect * from #t declare @t table(id int)declare @i intset @i=1while @i<=31begin insert into @t select @i set @i=@i+1endselect * from @tid ----------- 12345678910111213141516171819202122232425262728293031(所影响的行数为 31 行) select top 31 identity(int,1,1)TID into #s from sysobjectsselect * from #sdrop table #s MSSQL根据年龄算生日 字段类型为datetime型,页面输入年月日(2006-7-4),保存到数据变成1905-5-23,为可?? sql server 2012统计 有关于路径问题 请问下面的查询语句该怎么写? 这段trigger的代码有问题吗?在线等待,马上送分 两个很基础的问题? 图片存储在库中好呢还是库中存路径好呢 一个SQL语句的问题,不知道用简单的方法来做是否很难? 在线等,一个查询问题,很急,100分,对了马上结 MSSQL1433端口怪异现象!!!灵异!!! 行转列的问题?
--用临时表select top 31 identity(int,1,1) as ID
into #tp
from syscolumns c1,syscolumns c2
select * from #tpdrop table #tp
declare @i int
set @i=1
while @i<=31
begin
insert into @t select @i
set @i=@i+1
endselect * from @tid
-----------
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31(所影响的行数为 31 行)
drop table #s