Mimer SQL Documentation TOC PREV NEXT INDEX

Mimer SQL Developer Site


Setting Column Labels


Columns in the result table normally have the same name as the corresponding columns in the source table.

By using an AS clause after the column name in the SELECT statement, the column in the result table can be given an alternative name.

AS clauses can be used for as many columns as required. A label may be up to 128 characters long, and follows the same syntax rules as column names, see the Mimer SQL Reference Manual, SQL Identifiers.

For example:
 SELECT format AS format_name, category_id
    FROM formats;
Returns:

 FORMAT_NAME
CATEGORY_ID
 Audio CD
1
 Cassette
1
 DVD Audio
1
 Vinyl
1
 Audio Cassette
2
 Audio CD
2
 Hardcover
2
 Paperback
2
 DVD Video
3
 Video
3

Labels are particularly useful in queries that retrieve computed values, where the result table column is otherwise unnamed, see Retrieving Computed Values.


Mimer
Mimer Information Technology AB
Voice: +46 18 780 92 00
Fax: +46 18 780 92 40
info@mimer.se
Mimer SQL Documentation TOC PREV NEXT INDEX