Use standard SQL statements to implement paging operations (Oracle)

zhaozj2021-02-12  177

method one:

Select * from ??????? (SELECT ROWNUM AS MY_ROWNUM, A. * from? My_TABLE? WHERE ROWNUM <20000) Where my_rownum> = 10000

Method Two:

Select * from my_tablewhere rownum <= 20000 minus (select * from my_table where rownum <10000)

In contrast, the method has a high efficiency.

Method 1 Improvement:

Remove my_rownum field

Select C. * from ??????? (SELECT ROWNUM AS MY_ROWNUM, A. * from? my_table? a? WHERE ROWNUM <20000) B, MY_TABLE? C Where my_rownum> = 15000 and C.ID = B.ID ;

转载请注明原文地址:https://www.9cbs.com/read-6724.html

New Post(0)