码迷,mamicode.com
首页 > 其他好文 > 详细

【OCP认证12c题库】CUUG 071题库考试原题及答案(28)

时间:2019-02-21 12:18:31      阅读:136      评论:0      收藏:0      [点我收藏+]

标签:exe   category   net   app   display   out   val   eval   where   

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 命令未正确结束”错误)

【OCP认证12c题库】CUUG 071题库考试原题及答案(28)

标签:exe   category   net   app   display   out   val   eval   where   

原文地址:http://blog.51cto.com/13854012/2352847

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!