select * into #temp from table
alter table #temp
add column id int identity not null
select * from #temp where id between 10 and 20
alter table #temp
add column id int identity not null
select * from #temp where id between 10 and 20
解决方案 »
- SQL里面的作业调度可以直接执行ASP语句么?
- 无法向SQL SERVER2000 插入数据
- 有關數據轉換問題
- SQL Server 2005的客服端连接SQL Server 2008服务器
- 相似重复问题-----去重(2000分)
- SQL SERVER用户登录的问题
- 如何求总?
- 怎么作安装程序使得能生成数据库中的所有表、存储过程、job等等?
- 如何在sql-plus中删除两个表之间的关联关系(外键)。
- 一个没有办法的问题???希望能进来帮帮忙???谢谢各位
- 如何利用vb将一张图片存入数据库中???十万火急,在线等!!
- set @i=exec('select count(*) from '+@biao);这样写有问题吗?(特急)
select IDENTITY(int, 1,1) AS ID_Num,* into #temp from 表
select * from #temp where ID_Num>10 and ID_Num<=202、
exec('SELECT Top '+cast(@PageSize as varchar)+' * FROM T WHERE SortField NOT IN (SELECT TOP '+cast(@PageSize* @Pagei as varchar)+' SortField from T )')
查询N-M条记录。
select IDENTITY(int,1,1) as iid,* into #temptable from yourtable
select top M-N * from #temptable where iid>=NOR:select top M-N * from yourTable where id not in(select top N-1 id from table)
ID为表具有唯一值的任何字段
select * from #kk where id between 10 to 20
alter table #temp
add column id int identity not null
select * from #temp where id between 10 and 20
drop #temp