3 1 1 Enhance your Query

LANSA Client

3.1.1 Enhance your Query

Unless you add some sorting or grouping criteria to your query, the data you will receive will be a continuous list of records containing the fields you have requested, in the sequence in which it is stored in the primary file on the host. In some cases, this may be suitable for your purposes, in others, the data may be more useful if you sort it and, if suitable, add selection criteria to eliminate any unwanted data.

To specify selection and sorting criteria for a query, use these commands from the Options menu:

  • Sort options, to specify the sequence.
  • Field conditions, to specify the selection criteria.
  • Group by, to split your data into groups.
  • Summary options, to add totals.

Except for field conditions, you can use these commands when you are creating your query as well as after the query has been run, when you are viewing the results in the Results window.

Unless you are unsure of what your query will retrieve, your query will run quicker if you assign these options before running the query.

If you change a query's conditions after you have run it, you will be asked if you want to save the new criteria before you close it.

Note that "fields" are referred to when you are working in the Query window, but "columns" when you are working in the Results window.

Further Information

Ý 3.1 Steps to Create a Query