2.2.12.3.2 Group Aliases in the SELECT Statement

The SELECT statement MUST support grouping several properties under an alias. The protocol server MUST then allow the protocol client to use the alias instead of a property name in the FREETEXT and CONTAINS predicates in the rest of the SELECT statement. To do this, the SELECT statement MUST support the optional WITH clause, which MUST be of the following form:

 …WITH (property_1, property_2, …) AS #name…

The property_n components MUST be identifiers for the properties that are to be grouped under the alias #name. All alias names MUST begin with a pound sign. For example, the following query example:

 SELECT title, path FROM SCOPE() WHERE WITH (title, author) AS #x FREETEXT(#x, ‘bill’)

returns all items having Title or Author properties contain the word "bill".

 group-aliases      =      "WITH" *ws "(" *ws property-list *ws ")" *ws "AS" 1*ws alias-name
 property-list      =      identifier [*ws "," *ws property-list]