Re: How to select first N rows?
Posted in 1997
In article <EK9yI5.1Gu@nonexistent.com>, Jacob Salomon <jake@garpac.com> writes <snip> >The more essential question might be: Is there a way to tell the engine >to return oly the first 20 (or N) rows of a query? Sally's 4GL solution >does not quite cut it, since by the time the app has gotten 20 rows from >the engine, the engine itself has internally set up for the first 87 (or >some other arbitrarily large count) rows. Thus, it fails as a time >saver, the primary reason for desiring such a feature. (Are you >listening right now, Art? ;-) > >I have heard rumors that in 7.3 there is a syntax for telling the engine >to stop searching after finding the first N rows for a query. I suspect all this could do (which is what I believe the Ingres one does) is to stop returning rows after the first n. In many cases there is NO WAY of knowing what the first 20 rows are until you have finished the query. This is most certainly the case where informix is using temporary tables for the 'ORDER BY' clause. -- Sally Woolrich My Email address has been altered to limit junk mail. Please remove the second 'x' in the company name to Email me.