SQL server allows the syntaxselect rank = a + b from t order by rank
meaning that rank can be used as a alias for the expression a+b. This behaviour is not in accordance with the SQL standard where rank = a + b
shall be treated as a boolean expression. If rank and a + b have comparable types the statement would be semantically correct and would return records with values either being TRUE or FALSE.So the queryselect g1.Player,g1.hcap,Rank = (select count(*) + 1from SQLTeam_Golfers g2where g1.hcap < g2.hcap)from SQLTeam_Golfers g1order by Rank
is valid SQL in a DBMS that supports boolean. When used in DBMS (other than SQL server and Sybase) which does not suport boolean, the query would certainly result in a syntax error.