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?
![](http://img.blog.csdn.net/20160307150014784?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center)
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 可以使用列别名
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 可以使用列别名
相关文章推荐
- 奔五的人学IOS:swift练手与csdn,最近学习总结
- C#使用LINQ中Enumerable类方法的延迟与立即执行的控制
- 端口号、进程号之间关系
- android:windowSoftInputMode属性解析
- NSURLSession的基本使用
- 从 Qt 的 delete 说开来
- EditText使用技巧
- javascript操作cookie
- 通过本地加载ga.js文件提高Google Anlytics性能
- 辛星解读mysql的用户管理
- 通过阅读教材,所得的不懂的问题
- postgresql常用命令
- 体绘制之光线投射算法(附源码)
- 机器人的运动范围
- 项目开发经验总结
- 这篇文章给大家介绍Android开发四大组件之实现电话拦截和电话录音,涉及到android四大基本组件在程序中的应用,对android四大基本组件感兴趣的朋友可以参考下本篇文章
- 如何解决GIF流量爆炸问题?
- MySQL5.6 PERFORMANCE_SCHEMA 说明
- ReactJS实用技巧(1):JSX与HTML的那些不同
- nginx实例解析