方法一:
--注释:
--table1 是你要查询的数据表名
--table2 ,table3 是你随便定义的一个表名什么都可以不能没有
--ID 是要排序用到的表的字段,这里必须是唯一的字段(主键)
--最后要注意:不能用自动增长的记录ID号来代替ID(因为记录有可能被删除)
哪位大虾能够指点一下,不排序也能得到数据行
方法二:
--注释:
--表中必须存在identity
select * from(select top m-n+1 * from
(select top m * from table1 order by id asc)
as table2 order by id desc)
as table3 order by id
--注释:
--table1 是你要查询的数据表名
--table2 ,table3 是你随便定义的一个表名什么都可以不能没有
--ID 是要排序用到的表的字段,这里必须是唯一的字段(主键)
--最后要注意:不能用自动增长的记录ID号来代替ID(因为记录有可能被删除)
哪位大虾能够指点一下,不排序也能得到数据行
方法二:
--注释:
--表中必须存在identity
select * from tablename where identitycol between n and m