Re: SELECTing first x results (a FAQ?)
Posted in 1998
"D. Sanderson" <dsanders@u.washington.edu> wrote:
>
>Despite the fact that this is probably a common question, all the usual
>sources (Informix manuals, Informix and SQL FAQs, DejaNews) came up empty.
>(I apologize ahead of time, particularly because I'm pretty sure I *did*
>see this in a manual somewhere, but I just can't find it now.)
>
>I want an SELECT statement that returns the first x results (x being a
>constant, say, 50) matching certain criteria. (I want an exact number, so
>I can't use the 'fraction of' formula in the FAQ.)
>
>Our client uses a port (just one) to get to the database, and I don't want
>a broad user-specified search to tie up the port getting hundreds of
>results.
>
>Many thanks for any assistance you can provide!
>
>_____________________________________________________________________
>Dan Sanderson dsanders@u.washington.edu
>University of Washington http://weber.u.washington.edu/~dsanders
>
What version of the engine are you running? I'm
pretty sure 7.3 supports the following syntax:
SELECT FIRST N * FROM TABLE
-------------------------------------------------------
"You're missing the point," said the fork to the spoon.