Andrey.Kyurkchiev Andrey.Kyurkchiev - 2 years ago 152
SQL Question

Oracle SQL Developer 11g OFFSET FETCH gives error

I am making a query and trying to fetch a random number of rows from a database but Oracle keeps telling me my command has not been ended properly.

select *
from random_table
order by random_column_name
offset 0 rows
fetch first 10 rows only

This is the code I'm using.

I would greatly appreciate any support since I've spent quite some time searching for an explanation for the outcome I'm getting, but to no avail.

Answer Source

That syntax isn't valid until Oracle Database 12c.

You would say instead

select *
from random_table
order by random_col
where rownum < 11
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download