Limiting the number of rows returned from a query
You can create a report that contains a limited number of ordered entries.
Procedure
Example
For example, to create a report that contains the five managers with the most years of service, you could use the following query and QMF command.
SQL query:
SELECT NAME, YEARS
FROM Q.STAFF
WHERE JOB='MGR'
ORDER BY YEARS DESC
QMF command:
RUN QUERY (ROWLIMIT=5
Resulting report:
NAME YEARS
--------- ------
JONES 12
QUILL 10
HANES 10
LU 10
LEA 9