Re: How can I limit the NUMBER of rows returned?

From: <morleb_at_cbr.hhcs.gov.au>
Date: 31 Jan 95 09:22:37 +1000
Message-ID: <1995Jan31.092237.1_at_cbr.hhcs.gov.au>


In article <3ghgbr$g3l_at_news-s01.ca.us.ibm.net>, ebsmith_at_ibm.net writes:
> Doing selects from Solaris middleware with ProC to an Oracle7 server.
> Returned tables are normally small & quick, but occasionally we get a query
> which returns way too many rows so that even the first fetch is greatly delayed.
> I'd be happy to take the first 100 rows quickly, and ignore the rest.
> Any suggestions?
> --Baird Smith

Try using the pseudocolumn ROWNUM in your where clause

e.g. WHERE .......

       AND ROWNUM < 101

-- 
----------------------------------------------------------------------
Brian Morley       morleb_at_cbr.hhcs.gov.au
Dept Human Service & Health, Brisbane, Australia
Received on Tue Jan 31 1995 - 00:22:37 CET

Original text of this message