SQL SELECT statement recommendations
When customizing, some conventions must be followed to produce consistent results and the complete page format as demonstrated within the distributed reports.
The recommendations for SQL SELECT statements are as follows:
The first two columns returned in the SELECT statement should be LOCATION and SUBSYSTEM, in that order.
Placing these two columns first in the SELECT statement results in page breaks on LOCATION and SUSBSYSTEM changes. The columns normally produced within the body of the report do not occur when this convention is observed. This information will be reported within the page header lines instead.
If you do not observe this convention, the report will have no special page breaks based on these values. The data, if selected in other than the first two columns, will occur as columns within the body of the report.
The last two columns in the SELECT statement should be MIN(DATETIME) and MAX(DATETIME), in that order.
Placing these columns in the SELECT statement results in the range of data encountered within the tables to be reported within the page header. When this convention is followed, these last two columns do not appear in the body of the report. Be careful not to select other timestamp data type columns as the last two columns to avoid incorrect results.
If you do not observe this convention, blanks appear in place of these date ranges in the page headers.
When LOCATION andSUBSYSTEM are the first two columns selected, LOCATION andSUBSYSTEM should be the highest sequencing field in an ORDER BY clause in the SELECT statement.
This procedure allows the reports with page breaks on LOCATION andSUBSYSTEM changes to be properly paginated.
Failure to follow this convention can result in quite excessive and incorrect pagination for the report.
Related topic