Hello to everybody!
I've searched for a long time to get a simple solution for the missing LIMIT X,Y in Oracle.

Finaly I've found this solution:

select * from (select rownum as ROW_ID, X, Y from DATABASE) where ROW_ID between MIN and MAX

rownum is a virtual column, which is automatically added by Oracle.

Don't despair on Oracle - It's not so slow, bad, crazy ...

Best wishes

Toni

    A word of caution though. ROWNUM looses its meaning, when you use ORDER BY clause. ie., ROWNUM is set immediately after the query is executed and BEFORE the sorting as specified in ORDER BY takes place.

      8 months later

      But this can help:
      If you embed the ORDER BY clause in a subquery and place the ROWNUM condition in the top-level query, you can force the ROWNUM condition to be applied after the ordering of the rows. For example, the following query returns the 10 smallest employee numbers
      SELECT FROM(
      SELECT
      FROM employees ORDER BY employee_id)
      WHERE ROWNUM < 11;

      http://download-west.oracle.com/otndoc/oracle9i/901_doc/server.901/a90125/sql_elements6.htm#33158

        Write a Reply...