您的位置:首页 > 其它

112.View the Exhibit and examine the structure of the PROMOTIONS table.

2016-03-07 15:00 501 查看
112.View the Exhibit and examine the structure of the PROMOTIONS table.

Evaluate the following SQL statement:

SQL>SELECT promo_category, AVG(promo_cost) Avg_Cost, AVG(promo_cost)*.25 Avg_Overhead

FROM promotions

WHERE UPPER(promo_category) IN ('TV', 'INTERNET','POST')

GROUP BY Avg_Cost

ORDER BY Avg_Overhead;

The above query generates an error on execution.

Which clause in the above SQL statement causes the error?



A.WHERE

B.SELECT

C.GROUP BY

D.ORDER BY

答案:C

解析:列别名,不能用于where中,group by中,这其实是一个sql语句执行顺序的问题

1.from

2.where

3.group by

4.having

5.select

6.order by子句

通过这个可以知道order by 可以使用列别名
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: