On top of that, you could also do:
Code:
SELECT score, age, (score * age) AS score_age
FROM table
ORDER BY score_age;
Yes, use normal parentheses for expressions in SQL.
The keyword "AS" is optional, but with or without it the name following the expression is called an "alias" and you *can* use aliased names in the ORDER BY clause.
When you get there: You can also use aliased names in a HAVING clause, but you can't use them in WHERE or GROUP BY (because they aren't created before or at the point in time that the WHERE or GROUP BY would need them). So as ugly as it might seem, you have to repeat the expressions:
[code]
Code:
SELECT score, age, (score * age) AS score_age
FROM table
WHERE (score * age) > 132
ORDER BY score_age;
Even though you have to repeat the expression, be assured that any good query processor will manage to optimize the code so that the expression is really only evaluated once.