In mysql, I do this:
select *
from sometable
order by name
limit 10,20
In which case I get the 21st to the 30th rows (skip the first 20, give the next 10). The rows are selected after the order by, so it really starts on the 20th name alphabetically.
In Oracle, the only thing people mention is the rownum pseudo-column, but it is evaluated before order by, which means this:
select *
from sometable
where rownum <= 10
order by name
will return a random set of 10 rows ordered by name, not usually what I want. Plus, you can't specify an offset.
So is there a way to do a mysql style limit clause in Oracle?
Thanks