Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Receiving Query result...
I tried this once and it worked for some and not for others. My problem
is that I was using order by and some logical operators and comparison.
But if you are using logical operators and comparison then is not going
to work regardles of what you do. You read the table and then apply the
condition so when it hits 10 read rows it quits.
Maybe you could and this is just an idea, use a table(array) and store them and then get the last 10 from the array in looping in reverse order.
Or maybe there is a way to use the rowid of the table to find the last 10 of your query.
I don't really have an answer but will like to hear what solution has been implemented for this.
Juan
Hans Duijn wrote:
>
> Hi,
>
> To all the SQL gurus. Is there a way to receive the last ten rows from a
> selection (based upon a cursor). I know I can use ROWNUM for that purpose
> but when I want the result to be sorted I have to create a VIEW and use
> GROUP BY. As I said, this works but is rather slow an lot of work around.
>
> Anyone an idea?
>
> Thanks
Received on Tue Apr 28 1998 - 16:10:07 CDT