| United States-English |
|
|
|
![]() |
Communicator HP e3000 MPE/iX Express 2 Based on Release 6.5: HP e3000 MPE/iX Computer Systems > Chapter 3 Technical ArticlesUsing the AS Clause in ALLBASE/SQL |
|
By Kumaran N.S. The AS Clause allows users to specify an alias name for the items in the Select Statement. The specified alias name will be returned as the column heading in the query result. -- Select Statement Level -- [BULK] QueryExpression [ORDER BY {ColumnID [ASC ]} [,...]] [ { [DESC]} ] -- Subquery Level -- (QueryExpression) -- Query Expression Level -- {QueryBlock } [UNION [ALL] {QueryBlock }] [...] {(QueryExpression)} [ {(QueryExpression)}] -- Query Block Level -- SELECT [ALL ] SelectList [INTO HostVariableSpecification] [DISTINCT] FROM FromSpec [,...] [WHERE SearchCondition1] [GROUP BY GroupColumnList] [HAVING SearchCondition2] where SelectList = {* } {[Owner.]Table.* } {CorrelationName.* } [,...] {Expression AS Alias_name } {[[Owner.]Table.]ColumnName AS Alias_name } {CorrelationName.ColumnName AS Alias_name} where Alias_name can be an identifier, a single-quoted string or a double-quoted string SELECT PartNumber AS "Part Number" , AVG (UnitPrice) AS avg_price, AVG (deliverydays) AS 'avg days' FROM PurchDB.SupplyPrice GROUP BY partnumber; If the alias name is specified as an identifier it should conform to the following rules which are the rules defined for "Basic Names" in ALLBASE/SQL.
When the alias name is specified as a single-quoted identifier or as a double-quoted identifier, it can contain spaces and special characters in addition to the characters allowed in the "Basic Names," as defined above, and the name can be up to 20 characters in length. The alias name cannot be only spaces and it should not be of zero length, i.e., it cannot be specified as '' or as "".
|
|||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||