每日一练 003
答案:B
考点;orde by的限制。
1.order by 后面不能跟 LOB、 LONG、 LONG ROW 类型的列。
2.select 语句中有 distinct 关键字, order by 后面的列 必须出现在 select 子句中。
3.order by 根据字符排序时, 区分大小写
针对C答案做了测试。comm出现还是没出现在select后边都可以。对order by用comm排序 输出结果是一样的。
SCOTT@PROD> select job,sal,comm from emp order by comm desc;
JOB SAL COMM
CLERK 800
MANAGER 2450
ANALYST 3000
CLERK 950
CLERK 1100
MANAGER 2975
MANAGER 2850
CLERK 1300
ANALYST 3000
PRESIDENT 5000
SALESMAN 1250 1400
SALESMAN 1250 500
SALESMAN 1600 300
SALESMAN 1500 0
14 rows selected.
SCOTT@PROD> select job,sal from emp order by comm desc;
JOB SAL
CLERK 800
MANAGER 2450
ANALYST 3000
CLERK 950
CLERK 1100
MANAGER 2975
MANAGER 2850
CLERK 1300
ANALYST 3000
PRESIDENT 5000
SALESMAN 1250
SALESMAN 1250
SALESMAN 1600
SALESMAN 1500
14 rows selected.




