B
B
beduin012020-02-05 13:19:55
Oracle
beduin01, 2020-02-05 13:19:55

How to organize the correct LIMIT in Oracle?

I need to get the first 10 records. On the Internet for Oracle 11, they suggest doing this:

SELECT * FROM (
       select name from ...
       ) WHERE rownum < 10

those. via on request. I understand correctly that this is not effective. at the beginning, the whole subquery will be executed, and then it will be filtered? Or how are things?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
MagicMight, 2020-02-05
@MagicMight

select * from some_table
where rownum<=10

works fine too
what's the rationale for using a subquery?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question