oracle rownum·ÖÒ³³öÏÖÖØ¸´Êý¾Ý

2014-11-24 13:09:28 ¡¤ ×÷Õß: ¡¤ ä¯ÀÀ: 0
oracle rownum·ÖÒ³³öÏÖÖØ¸´Êý¾Ý
ͨ³£Ò»°ãµÄ·ÖÒ³Óï¾äÈçÏ£º
select *
from (
select row_.*, rownum rownum_
from ( select p.id from table1 p
order by p.DATA_UPDATE_TIME desc )
row_ where rownum <= £¿) b
where b.rownum_ >£¿

µ±ºì×Ö²¿·ÖµÄ DATA_UPDATE_TIME ²»ÄÜΨһȷ¶¨¼Ç¼µÄ˳Ðò¾Í»á³öÏÖÕâ¸öÎÊÌ⣬±ÈÈçÓÐÖØ¸´µÄDATA_UPDATE_TIME ¡£
Ö»Òª½«Óï¾äд³É£º
select * from (    

select row_.*, rownum rownum_    

from (   

select p.id from table1 p    

order by p.DATA_UPDATE_TIME desc    

) row_   )    

where rownum_ >   and rownum_ <=   

¾Íok.
ÁíÒ»Öָ퍣º
select *
from (
select row_.*, rownum rownum_
from ( select p.id from table1 p
order by p.DATA_UPDATE_TIME desc£¬p.id desc )
row_ where rownum <= £¿) b
where b.rownum_ >£¿

ÔÙ¼ÓÒ»¸ö²»Öظ´µÄÒ²¾ÍÐÐÁË