1z0-071 Oracle Database 12c SQL 第48题 GROUP BY

Q48.  Which two statements are true regarding the GROUP BY clause in a SQL statement? (Choose two.)
A. You can use column alias in the GROUP BY clause.
B. Using the WHERE clause after the GROUP BY clause excludes the rows after creating groups.
C. The GROUP BY clause is mandatory if you are using an aggregate function in the SELECT clause.
D. Using the WHERE clause before the GROUP BY clause excludes the rows before creating groups.

E. If the SELECT clause has an aggregate function, then those individual columns without an aggregate function in theSELECT clause should be included in the GROUP BY cause.

Correct Answer: DE

【注意】分组group by一般与聚合函数连用,即先分组再聚合(如先分组再求和、先分组再求平均等等)。group by如果只是对行进行单独的分组使用,那么使用意义不大。在复杂的SQL查询中Group by子句大多数时候与聚合函数一起出现。

猜你喜欢

转载自blog.csdn.net/u013012406/article/details/80768303
今日推荐