Summary
LCE270 - Top-10 and Bottom-10 Query
What I Should Know
- By using a combination of Sort options and Maximum records, I can create a Top-10 style query. To do this, I need to ensure that the data is on the host and not at the local PC. To ensure that the data is sorted on the host, I can either create a join query or use the Like operator with an All Values prompt, and use the Output Options command to set the Maximum records to the number I require.
- I can force data to be sorted on the server by:
- Using a Join query. (A join query follows a different sort algorithm from a query over a single file.)
- Using an 'is like' condition on any of the fields in my query. (That is, the 'is like' condition with 'All values' (or 'is like *'.)
- Using a condition on a non-key field (except the 'is equal' condition) with no virtual fields in my query.
- Sorting on the IBM i happens in EBCDIC sequence (letters before numbers: A,B,Z,1).
- Sorting on the PC happens in ASCII or ANSI sequence (numbers before letters: 1,2,9,A).