117. 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 dividing them into groups.
C. The WHERE clause can be used to exclude rows before dividing them into groups.
D. The aggregate functions and columns used in the HAVING clause must be specified 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
different columns in the table.
Answer: AC
本文探讨了SQL语句中WHERE与HAVING子句的区别与用法。WHERE子句用于在分组前排除行,而HAVING子句则用于在分组后过滤组。文章澄清了一些常见误区,并提供了正确使用这两个子句的指导。
2738

被折叠的 条评论
为什么被折叠?



