Chinaunix首页 | 论坛 | 博客
  • 博客访问: 673813
  • 博文数量: 487
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 4936
  • 用 户 组: 普通用户
  • 注册时间: 2018-07-05 13:59
个人简介

ocp考试资料群:569933648 验证码:ocp OCP 12c 19c考试题库解析与资料群:钉钉群号:35277291

文章分类

全部博文(487)

文章存档

2024年(2)

2023年(37)

2021年(151)

2020年(37)

2019年(222)

2018年(38)

我的朋友

分类: Oracle

2019-02-21 11:38:29

28.choose the best answer


Evaluate the following SQL statement:


SQL> SELECT promo_id, promo_category


FROM promotions


WHERE promo_category = 'Internet' ORDER BY 2 DESC


UNION


SELECT promo_id, promo_category


FROM promotions


WHERE promo_category = 'TV'


UNION


SELECT promo_id, promo_category


FROM promotions


WHERE promo_category ='Radio';


Which statement is true regarding the outcome of the above query?


A) It produces an error because the ORDER BY clause should appear only at the end of a compound query-that is, with the last SELECT statement.


B) It executes successfully and displays rows in the descending order of PROMO_CATEGORY.


C) It produces an error because positional notation cannot be used in the ORDER BY clause with SET operators.


D) It executes successfully but ignores the ORDER BY clause because it is not located at the end of the compound statement.


Answer:A


(执行时 order by 子句只能出现最后的 select 语句,否则出现“ORA-00933: SQL 命令未正确结束”错误)
阅读(545) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~