Rules for Aliases in DBOPs that Contain Aggregate Functions

If your database operation includes a SQL statement that involves aggregate functions such as SUM, you must use aliases for any column names to which such aggregate functions refer.

Each alias must follow the rules for valid JavaScript identifiers:

For example, in the following SQL statement, dollarsum is an alias for the sum of the column named DOLLARS.

SELECT
sum(DOLLARS) dollarsum, CUSTOMERID FROM sales GROUP BY CUSTOMERID
ORDER BY CUSTOMERID

Send your feedback on this help topic to Sybase Technical Publications: pubs@sybase.com

Your comments will be sent to the technical publications staff at Sybase, Inc. For product-related issues or technical support, contact Sybase Technical Support at 1-800-8SYBASE.