按照列的别名来进行排序-SQL语言基础

时间:2024-05-15 13:24:51
【文件属性】:

文件名称:按照列的别名来进行排序-SQL语言基础

文件大小:5.26MB

文件格式:PPT

更新时间:2024-05-15 13:24:51

SQL 基础

按照列的别名来进行排序 * SQL> SELECT empno, ename, sal*12 annsal 2 FROM emp 3 ORDER BY annsal; EMPNO ENAME ANNSAL --------- ---------- --------- 7369 SMITH 9600 7900 JAMES 11400 7876 ADAMS 13200 7654 MARTIN 15000 7521 WARD 15000 7934 MILLER 15600 7844 TURNER 18000 ... 14 rows selected. * SELECT empno, ename, sal*12 annsal FROM emp ORDER BY annsal; Sorting by Column Aliases You can use a column alias in the ORDER BY clause. The slide example sorts the data by annual salary.


网友评论