Re: How can I get the first 20 records !!

From: Tony <andrewst_at_onetel.net.uk>
Date: 19 Mar 2003 12:45:31 -0800
Message-ID: <c0e3f26e.0303191245.6377319f_at_posting.google.com>


Miko_at_boehrer.de (Ralf) wrote in message news:<fa624200.0303190707.2652ad4c_at_posting.google.com>...
> 2. select * from
> ( select * from address where lastname >= ' ' order by lastname,firstname)
> where rownum <= 20;
> (This does work properly, but it takes to much time to get the results
> because the inner select-statement creates a big cursor. This is the
> reason why I can't use this type of select-statement).

Are you SURE this takes a long time, or are you assuming it will? What is a "big cursor" anyway? If there is an index on (lastname,firstname) I would expect this to be very quick. It will start fetching rows in order, and stop after the first 20. Received on Wed Mar 19 2003 - 21:45:31 CET

Original text of this message