ITPub博客

首页 > 数据库 > Oracle > OCP 1Z0-051-116

OCP 1Z0-051-116

原创 Oracle 作者:LuiseDalian 时间:2014-05-21 06:37:57 0 删除 编辑
(116)Examine the data in the ORD_ITEMS table:

ORD_NO   ITEM_NO  QTY

 

You want to find out if there is any item in the table for which the average maximum quantity is more than 50.

You issue the following query:

SELECT AVG(MAX(qty)) FROM ord_items GROUP BY item_no HAVING AVG(MAX(qty)) > 50;

Which statement is true regarding the outcome of this query?

A. It executes successfully and gives the correct output.

B. It gives an error because the HAVING clause is not valid.

C. It executes successfully but does not give the correct output.

D. It gives an error because the GROUP BY expression is not valid.

答案:(B)

解析:

scott@TESTDB11>select avg(max(sal)) from emp group by deptno

  2  having avg(max(sal)) > 3000;

having avg(max(sal)) > 3000

           *

ERROR at line 2:

ORA-00935: group function is nested too deeply

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/17013648/viewspace-1165707/ ,如需转载,请注明出处,否则将追究法律责任。

上一篇: OCP 1Z0-051-113
下一篇: OCP 1Z0-051-115
请登录后发表评论 登录
全部评论

注册时间:2012-02-06

  • 博文量
    1986
  • 访问量
    6040880