Renaming Columns in Query Results

When query results are displayed, the name given to a column when it was created is used as the default heading. To produce more readable results, you can specify a different column heading by using either column_heading = column_name or column_name column_heading instead of using the column name in a select list.

For example, to change pub_name to Publisher in the preceding query, type either of the following statements:

SELECT Publisher = pub_name, pub_id
FROM publishers

SELECT pub_name Publisher, pub_id
FROM publishers

The results of both statements look like this:

Publisher             pub_id  
---------------------------
New Moon Books        0736
Binnet & Hardley      0877
Algodata Infosystems  1389
Five Lakes Publishing 1622
Ramona Publishers     1756
GGG&G                 9901
Scootney Books        9952
Lucerne Publishing    9999

(8 row(s) affected)