Subject | Re: Search Procedure |
---|---|
Author | Andrew |
Post date | 2002-10-07T08:28:37Z |
Firebird1 release notes:
SELECT [FIRST (<integer expr m>)] [SKIP (<integer expr n>)]
Retrieves the first m rows of the selected output set. The optional
SKIP clause will cause the first n rows to be discarded and return an
output set of m rows starting at n + 1. In the simplest form, m and n
are integers but any Firebird expression that evaluates to an integer
is valid. A identifier that evaluates to an integer may also be used
in GDML, although not in SQL or DSQL.
Parentheses are required for expression arguments and optional
otherwise. They can also bind variables, e.g. SKIP ? * FROM ATABLE
returns the remaining dataset after discarding the n rows at the top,
where n is passed in the "?" variable. SELECT FIRST ? COLUMNA,
COLUMNB FROM ATABLE returns the first m rows and discards the rest.
[Variable binding is not fully tested yet.]
The FIRST clause is also optional, i.e. you can include SKIP in a
statement without FIRST to get an output set that simply excludes the
rows appointed to SKIP. Available in SQL and DSQL except where
otherwise indicated.
Examples:
SELECT SKIP (5+3*5) * FROM MYTABLE;
SELECT FIRST (4-2) SKIP ? * FROM MYTABLE;
SELECT FIRST 5 DISTINCT FIELD FROM MYTABLE;
SELECT [FIRST (<integer expr m>)] [SKIP (<integer expr n>)]
Retrieves the first m rows of the selected output set. The optional
SKIP clause will cause the first n rows to be discarded and return an
output set of m rows starting at n + 1. In the simplest form, m and n
are integers but any Firebird expression that evaluates to an integer
is valid. A identifier that evaluates to an integer may also be used
in GDML, although not in SQL or DSQL.
Parentheses are required for expression arguments and optional
otherwise. They can also bind variables, e.g. SKIP ? * FROM ATABLE
returns the remaining dataset after discarding the n rows at the top,
where n is passed in the "?" variable. SELECT FIRST ? COLUMNA,
COLUMNB FROM ATABLE returns the first m rows and discards the rest.
[Variable binding is not fully tested yet.]
The FIRST clause is also optional, i.e. you can include SKIP in a
statement without FIRST to get an output set that simply excludes the
rows appointed to SKIP. Available in SQL and DSQL except where
otherwise indicated.
Examples:
SELECT SKIP (5+3*5) * FROM MYTABLE;
SELECT FIRST (4-2) SKIP ? * FROM MYTABLE;
SELECT FIRST 5 DISTINCT FIELD FROM MYTABLE;
--- In ib-support@y..., Quinton Marks <quinton_marks@y...> wrote:
> can anyone give me some ideas on how to return only a portion of
the records of a recordset?
> ie. Records 50 - 100 of 200 records?
> much appreciated
> Quinton.