You might want to limit the number of results that are returned for certain queries such that only the first n number of records are returned based on a specific set of criteria.
Note: This feature can be used only with Select queries.
Suppose you want to view the 20 most expensive equipment items according to total cost, where the value in the Breakdown Indicator field is set to True. In this case, you would create the query on the Equipment and Work History fields, joined via the Has Work History relationship, and add the Equipment ID, Equipment Short Description, and Total Cost fields to the query.
The Total Cost field is included, and the query is configured to show the sum of all total cost values, grouped by Equipment ID. In this case, rather than showing two separate rows in the results for each Work History record that is linked to this Equipment record, the results will contain one row for this Equipment record, and the Total Cost column will display the sum of the individual values in the Total Cost field in each Work History record. Additionally, the query is configured to show the results in descending order according to total cost.
Based on this query configuration, if you were to run the query at this point, you would see all Equipment records that meet the query criteria.
In this scenario, however, you want to view only the 20 most expensive pieces of equipment. To refine this query to suit your needs, in the Conditions section heading, set the limit to 20. When you run the query again, only those 20 Equipment records will be returned by the query.
If you are using a SQL Server database, sort the query by a field, and then configure the query to return a limited number of records, if more than one record contains the same value in the field by which you sorted the query, those records will be displayed in a random order relative to one another. For instance, if two Equipment records are linked to Work History records with the same total cost, each time you ran the query, those Equipment records would be displayed in a random order relative to one another. In other words, the first time you ran the query, the Equipment record with the ID 000000000001060839 might appear above the Equipment record with the ID 000000000001060840. The second time you ran the query, however, those Equipment records might appear in the reverse order. This limitation applies to SQL Server databases only.
Copyright © 2018 General Electric Company. All rights reserved.