OCP-1Z0-051 补充题库 第7题 ORDER BY 子句

该博客探讨了两道关于Oracle SQL的ORDER BY子句题目,指出尽管语法形式不同,但两道题目的SQL语句实际上产生相同的结果。ORDER BY 2表示根据查询结果的第二列进行排序,因此无需DESC也可默认为降序,选项A被确认为正确答案。
摘要由CSDN通过智能技术生成
一、原题
Evaluate these two SQL statements:
SELECT last_name, salary, hire_date FROM EMPLOYEES ORDER BY salary DESC;
SELECT last_name, salary, hire_date FROM EMPLOYEES ORDER BY 2 DESC;
What is true about them?
A. The two statements produce identical results.
B. The second statement returns a syntax error.
C. There is no need to specify DESC because the results are sorted in descending order by
default.
D. The two statements can be made to produce identical results by adding a column alias for the
salary column in the second SQL statement.

答案: A

二、题目翻译
评估下面两句SQL语句:
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值