我想把从n到m的纪录检索出来怎么做?如果是mysql,可以用 limit n,m 来实现我从MSSQL版看到的:关于limit的不同 在oracle中可以 select * from table where... limit int,int limit直接挂在后面很方便,但是SQLSERVER不支持LIMIT,很是郁闷 用 select top 3 * from tablename where key not in (select top 10 key from tablename)这种代替,实在是不方便
select * from emp where rowid not in ( select rowid from emp where rownum<3 ) and rownum<3;使用了not in ,感觉效率很低
取一段记录用minus select * from tablename where rownum<m minus select * from tablename where rownum<n 即取n-m间的记录
在oracle中可以
select * from table where... limit int,int
limit直接挂在后面很方便,但是SQLSERVER不支持LIMIT,很是郁闷
用
select top 3 * from tablename where key not in (select top 10 key from tablename)这种代替,实在是不方便
where rowid not in (
select rowid from emp where rownum<3 )
and rownum<3;使用了not in ,感觉效率很低
select * from tablename where rownum<m
minus
select * from tablename where rownum<n
即取n-m间的记录