Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: How to duplicate set fetchrows?

Re: How to duplicate set fetchrows?

From: Thomas J. Kyte <tkyte_at_us.oracle.com>
Date: Wed, 05 Apr 2000 13:22:08 GMT
Message-ID: <8cfelf$ode$1@nnrp1.deja.com>


In article <p9dmes8507etbcr1b33jrbfpisdi8j7idn_at_4ax.com>,   kenmn_at_tds.net wrote:
> Thanks for your help.
>
> I used to use "set fetchrows 200" to limit the number of rows returned
> in SQL*Worksheet, but it doesn't seem to work in 8.1.6.
>
> Anyone have any insight into how to accomplish the same thing.
>
> Rownums won't work because they get rearranged durring sorts.
>

In 8.1.5 and above you can:

select * from
( select * from T where ... ORDER BY ... ) where rownum <= 200
/

the order by will be done prior to the where rownum and it'll work.

> Best,
>
> Ken Sproule
> kenmn_at_tds.net
>
> Ken Sproule
> kenmn_at_tds.net
>

--

Thomas Kyte                              tkyte_at_us.oracle.com
Oracle Service Industries
http://osi.oracle.com/~tkyte/index.html --
Opinions are mine and do not necessarily reflect those of Oracle Corp

Sent via Deja.com http://www.deja.com/
Before you buy. Received on Wed Apr 05 2000 - 08:22:08 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US