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

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 可以是同一列。

(0)
上一篇 2022年3月22日
下一篇 2022年3月22日

相关推荐