Field Names and Aliases

<field_name> ::= [ [ ] <string> [ ] ]
<alias> ::= [ [ ] <string> [ ] ]

Field names are names of fields of the input records generated by an input format.

Aliases are alternative names for field-expressions, assigned in the SELECT or USING clauses. When a field-expression in the SELECT clause has been aliased, output formats will use the alias as the name of the corresponding output record field.
The alias of a field-expression can be also used anywhere else in the query as a shortcut that refers to the original field-expression.


Remarks:


Examples:

A. Basic field-expressions

The SELECT clause in the following example query specifies "basic" field-expressions only:
SELECT 'Event ID:', EventID, SYSTEM_TIMESTAMP()
FROM System

B. Derived field-expressions

The SELECT clause in the following example query specifies "derived" field-expressions only:
SELECT TO_UPPERCASE(cs-uri-stem), SUM(sc-bytes)
FROM \MyLogs\ex042805.log
GROUP BY TO_UPPERCASE(cs-uri-stem)

See also:

SELECT
USING

Basics of a Query


© 2004 Microsoft Corporation. All rights reserved.