Definition for alias '%1' must appear before its first reference

Error constant SQLE_ALIAS_NOT_YET_DEFINED
ODBC 2 State 37000
ODBC 3 State ERROR
Parameter 1 Name of the alias.
Severity 15
SQLCODE –831
SQLSTATE 42W61
Sybase error code 13837
Probable cause

An expression contains a reference to an alias, but the alias is defined later in the select list. The alias definition must appear before its first reference.