Impact of MAX-ROWS
- Last Updated: March 30, 2020
- 1 minute read
- OpenEdge
- Version 12.2
- Documentation
The MAX-ROWS qualifier on a query determines
the number of rows returned. The MAX-ROWS calculation
is applied before any sorting is applied to the query, causing
the results to be random. Consider the following example:
|
When this example is run with the OpenEdge sports database,
the first record return has custnum 54,
and the repeat loop displays other custnums in
descending order from there. When this example is run with the sports
database migrated to MS SQL Server, the first record returned has custnum 15,
and the repeat loop displays values in descending order from there.
This difference in results is a caused by the MAX-ROWS being
applied prior to the sorting.