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博客 ” ,链接:http://blog.itpub.net/17013648/viewspace-1165707/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/17013648/viewspace-1165707/