zoukankan      html  css  js  c++  java
  • 【OCP认证12c题库】CUUG 071题库考试原题及答案(28)

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

  • 相关阅读:
    使用Mysql慢查询日志对有效率问题的SQL进行监控
    wampserver3.1.0安装及配置
    Composer
    HTML5 本地存储(Web Storage)
    HTML5 元素拖动
    生成验证码
    git 基础命令
    POI使用流程
    JDK各版本新特性总结
    dubbo+zookeeper项目搭建
  • 原文地址:https://www.cnblogs.com/cnblogs5359/p/10411458.html
Copyright © 2011-2022 走看看