oracle账号 修改密码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 stateoracle账号ment only if they are applied to difierent columns in the table.

Answer: A, C

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

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

此条目发表在oracle metalink账号分类目录,贴了标签。将固定链接加入收藏夹。