The ROWNO predicate restricts the number of lines in a result table).
<rowno_predicate> ::= ROWNO < <unsigned_integer>
| ROWNO < <parameter_spec>
| ROWNO <= <unsigned_integer>
| ROWNO <= <parameter_spec>
unsigned_integer, parameter_spec
A ROWNO predicate may only be used in a WHERE clause that belongs to a QUERY statement. The ROWNO predicate can be used like any other predicate in the WHERE clause if the following restrictions are observed:
· The ROWNO predicate must be linked to the other predicates by a logic AND
· The ROWNO predicate must not be negated
· The ROWNO predicate may not be used more than once in the WHERE clause
You can specify the maximum number of lines in the result table using an unsigned integer or a parameter specification. If more lines are found, they are simply ignored and do not lead to an error message. Specifying a ROWNO predicate of the type ROWNO <= 0 results in an empty results table.
If a ROWNO predicate and an ORDER clause are specified, only the first n result lines are searched and sorted. The result usually differs from that which would have been obtained if a ROWNO predicate had not been used and if the first n result rows had been considered.
If a ROWNO predicate and a set function are specified, the set function is only applied to the number of lines restricted by the ROWNO predicate.