Sort keys with expressions
You can specify an expression with operators as the sort key for the result table of a SELECT statement.
When you specify an expression with operators as the sort key, the query to which ordering is applied must be a subselect.
Example
SELECT EMPNO, SALARY, COMM, SALARY+COMM AS "TOTAL COMP"
FROM EMP
WHERE SALARY+COMM> 40000
ORDER BY SALARY+COMM;The result table looks like the following example:
EMPNO SALARY COMM TOTAL COMP
====== ======== ======= ==========
000030 38250.00 3060.00 41310.00
000020 41250.00 3300.00 44550.00
200010 46500.00 4220.00 50720.00
000010 52750.00 4220.00 56970.00