select top 10 * from (select top 30 * from tbl order by 主键 desc) order by 主键 asc
select top 10 * from 表名 where id not in (select top 10 id from 表名)
有一个又笨又实用的方法.呵呵这个用的是pubs表select identity(int,1,1)as a_id,* into authors_copy from authors select * from authors_copy where a_id between 20 and 30要复杂的话,就得用游标了~
select top 10 * from (select top 30 * from tbl order by 主键 asc) order by 主键 desc
select identity(int,1,1)as a_id,* into authors_copy from authors select * from authors_copy where a_id between 20 and 30 好,用另一种要排序,破坏了顺序
select top 10 * from (select top 30 * from tbl order by 主键 asc) order by 主键 desc这样子直接吧select identity(int,1,1)as a_id,* into authors_copy from authors select * from authors_copy where a_id between 20 and 30 不知道哪个效率高 ?
select top 10* from (select top 20* from tbl order by 主键asc) x order by 主键desc
zhanbairu(sa) ( ) 信誉:100 2006-07-26 10:49:00 得分: 0 select top 10 * from 表名 where id not in (select top 10 id from 表名)-------- 我测了下,不行,下面这个可以。但却想不明白,盼各位指点下,谢谢!!select top 11 * from 表名 where id not in (select top 19 id from 表名 order by id asc) order by id asc
select ID=identity(int, 1, 1), * into # from 表名 select * from # where ID between 20 and 30
select * from table where id between 10 and 30????
from (select top 30 * from tbl order by 主键 desc)
order by 主键 asc
from (select top 30 * from tbl order by 主键 asc)
order by 主键 desc
好,用另一种要排序,破坏了顺序
from (select top 30 * from tbl order by 主键 asc)
order by 主键 desc这样子直接吧select identity(int,1,1)as a_id,* into authors_copy from authors select * from authors_copy where a_id between 20 and 30
不知道哪个效率高 ?
from (select top 20* from tbl order by 主键asc) x
order by 主键desc
我测了下,不行,下面这个可以。但却想不明白,盼各位指点下,谢谢!!select top 11 * from 表名 where id not in (select top 19 id from 表名
order by id asc) order by id asc
select * from # where ID between 20 and 30