Forum OpenACS Development: Re: How do I get first half rows from ORACLE table

Collapse
Posted by Sebastiano Pilla on
"First half" according to what order? Unless you impose an ordering on the result set (with an "order by" clause) it's impossibile to talk about first or second, or last if that matters. Oracle manages to store data in such a way that there's no guarantee that a simple select without order by will return the data in the order that has been inserted.
Collapse
Posted by Nis Jørgensen on
So, is there any way to return a subset of the records, based on an explicit ordering? Something like mySQL's LIMIT. It seems like ROWNUM can not be used for this purpose (although I may be wrong).
Collapse
Posted by Dirk Gomez on
select * from
  (select a,b,c,rownum
  from foobar
  order by bla)
where rownum < 10

should do the trick.