[b]1.SQL SERVER 是用先逆序再正序的方法[/b]
[b]2.ORACLE 用Minus和Rownum来实现 (Minus 减去 Union 联合 Intersect 返回相同的记录集)[/b]
或
[b]3.DB2[/b]
[b]4.MYSQL[/b]
From:[url]http://www.blogjava.net/cheneyfree/archive/2009/01/30/252759.html[/url]
select top 3 * from (select top 9 * from mvc_book order by bid) as s order by s.bid desc [第6,5,4条]
select * from (select top 3 * from (select top 6 * from mvc_book order by bid) as s order by s.bid desc) as s1 order by s1.bid [第4,5,6条]
select top 6 * from mvc_book where (bid not in (select top 2 bid from mvc_book))[第3,4,5,6,7,8条]
[b]2.ORACLE 用Minus和Rownum来实现 (Minus 减去 Union 联合 Intersect 返回相同的记录集)[/b]
select * from t_service_vnet_send where rownum <= 15 MINUS select * from t_service_vnet_send where rownum <= 10;
或
select * from (select rownum no,id,age,name from loaddata where rownum <= 3 ) where no >= 2;
[b]3.DB2[/b]
select * from (select ROW_NUMBER() over() as a, org.* from org) as temp where a>=n1 and a<=n2
[b]4.MYSQL[/b]
select * from tablename limit m,n;
From:[url]http://www.blogjava.net/cheneyfree/archive/2009/01/30/252759.html[/url]