ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 047-167

047-167

原创 Linux操作系统 作者:jbymy2000 时间:2012-03-19 10:40:39 0 删除 编辑
167. View the Exhibit and examine the description of the ORDERS table.
You need to display CUSTOMER_ID for all customers who have placed orders more
than three times in the last six months. You issued the following SQL
statement:
SELECT customer_id,COUNT(order_id)
FROM orders WHERE COUNT(order_id)>3 AND
order_date BETWEEN ADD_MONTHS(SYSDATE,6) AND SYSDATE
GROUP BY customer_id;
Which statement is true regarding the execution of the above statement?
A. It would execute successfully and provide the desired result.
B. It would not execute because the WHERE clause cannot have an aggregate
function.
C. It would not execute because the ORDER_ID column is not included in the
GROUP BY clause.
D. It would not execute because the GROUP BY clause should be placed before
the WHERE clause.
Answer: B
Where 条件里不能带合计函数,可以用having来求和

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

上一篇: 047-166
下一篇: 047-171
请登录后发表评论 登录
全部评论

注册时间:2012-01-10

  • 博文量
    416
  • 访问量
    205846