欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

Oracle Database 12c SQL面试题:WHERE和HAVING条件的题解

程序员文章站 2022-06-15 10:02:23
q2. which statements are true regarding the where and having clauses in a select statement? (choose...

q2. which statements are true regarding the where and having clauses in a select statement? (choose all that apply.)

a. the having clause can be used with aggregate functions in subqueries.b. the where clause can be used to exclude rows after piding them into groups.c. the where clause can be used to exclude rows before piding them into groups.d. the aggregate functons and columns used in the having clause must be specifed in the select list of the query.e. the where and having clauses can be used in the same statement only if they are applied to difierent columns in the table.

answer: a, c

对于 b 选项,子句要在 group 语句之前,不能之后排除。对于 d 选项,聚合函数和 having 子句指定的列不一定要在 select 列中出现。

对于 e 选项,where 和 having 可以是同一列。