[Fwd: [thelist] MySQL to Oracle]

Adam Patrick apatrick at oracular.com
Thu Aug 3 15:39:44 CDT 2000


> > The limit statement allows you to request a range of the results, say you
> > do a select on something and the result is 1000 lines long, with limit you
> > can select the rows 90 to 110 for example.

In Oracle, you can use Rownum to limit the size of your result set.  To
limit yourself to 100 rows use this:

where rownum <= 100


However, the rownum is assigned to a row before the sort is done. 
Therefore, the following is not meaningful (will not retrieve any rows):

where rownum between 90 and 110


The reason for this, I suppose, is that if rownum was assigned after the
sort, oracle would have already retrieved all rows and you wouldn't see
any performance gain anyway.  I thought I had heard something about
Oracle8 allowing you to specify when the rownum waws assigned but I just
searched the Docs real quick-like and didn't see anything about that.
(Anyone else hear that?)

So to answer your question I think you're going to have to do it in the
application.

-- 
_______________________________________________________________
Get your Private, Free FarmDance at http://farmer.oracular.com/




More information about the thelist mailing list