0

I'm using jQuery scroll bottom to load data getting from PHP + Oracle.

I tried to googling it but only show result for MySQL

//MySQL
$limitStart = $_POST['limitStart'];
$limitCount = 6;

$query = "SELECT id, name FROM countries ORDER BY name limit $limitStart, $limitCount";

Now I want it query using ORACLE query

$query = "SELECT id, name FROM countries ORDER BY name WHERE ROWNUM <= '$limitCount';

How to do that? to set the $limitstart?

Thanks

HiDayurie Dave
  • 1,791
  • 2
  • 17
  • 45
  • Possible duplicate of [How to add offset in a "select" query in Oracle 11g?](http://stackoverflow.com/questions/27099414/how-to-add-offset-in-a-select-query-in-oracle-11g) – timclutton Mar 20 '17 at 09:51

1 Answers1

0

Try this,

$query = "SELECT id, name FROM countries ORDER BY name
          OFFSET $limitStart ROWS FETCH NEXT $limitCount ROWS ONLY";

Refer http://docs.oracle.com/database/121/SQLRF/statements_10002.htm#BABBADDD and https://oracle-base.com/articles/12c/row-limiting-clause-for-top-n-queries-12cr1

Rohan Kumar
  • 40,431
  • 11
  • 76
  • 106