This document will outline how to define a custom label for a field in an SQL report. Fields in SQL report results will default to the name of the field in the Koha database. However, it is possible to add a custom label that is of more use to the report user.
Default label in the report results
When you run the report without alias created, the results will appear in a table with the default field names in the database at the top row of the table.
Adding a custom label in the report results
Identify the field to add an alias for.
To add a label to the result field insert the command AS.
Type in the preferred label for the field in quotes.
Running this report will show results using the defined alias instead of the standard label from the table in the database.
If the label is one word or phrase without a space, the label can be added without quotes.
If the label has multiple words with spaces, the label must be added with quotes.
It is not required to add alias for every field, just the field(s) to add a new name to.