D
D
Denis Popov2015-10-02 11:56:40
Oracle
Denis Popov, 2015-10-02 11:56:40

What is the optimal query for paging in Oracle?

Tell me the optimal query for page-by-page data output, what I found on the Internet does not work very fast.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Evgeny Komarov, 2015-10-02
@DenisDangerous

If I understand you correctly, you are looking for an analogue of LIMIT, but under oracle ...
I once wrote such a crutch:

SELECT * FROM 
    (SELECT A.*, ROWNUM RNUM FROM
    (/*Основной запрос выборки со всеми JOIN, GROUP, HAVING, ORDER*/) A 
    WHERE ROWNUM <=5/*По какую запись выбирать (предел)*/) 
WHERE RNUM >=1/*С какой записи выбирать (начальная позиция)*/;

Somewhere still working successfully

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question