I want do sorting by property ALL data in my db and ONLY AFTER that use LIMIT and OFFSET.
Query like this:
SELECT select_list
FROM table_expression
[ ORDER BY ... ]
[ LIMIT { number | ALL } ] [ OFFSET number ]
I know the sorting ends as soon as it has found the first row_count rows of the sorted result. Can I do sorting all data before calling LIMIT and OFFSET?
Prior to 12.1, Oracle does not support the
LIMITorOFFSETkeywords. If you want to retrieve rows N through M of a result set, you’d need something like:or using analytic functions:
Either of these approaches will sort give you rows N through M of the sorted result.
In 12.1 and later, you can use the
OFFSETand/orFETCH [FIRST | NEXT]operators: