125. Which three statements are true regarding the WHERE and HAVING clauses
in a SQL statement?
(Choose three.)
A. The HAVING clause conditions can have aggregate functions.
B. The HAVING clause conditions can use aliases for the columns.
C. WHERE and HAVING clauses cannot be used together in a SQL statement.
D. The WHERE clause is used to exclude rows before the grouping of data.
E. The HAVING clause is used to exclude one or more aggregated results after
grouping data.
Answer: ADE
Aggregate:合计
Having不能用别名
SQL> select a tt,sum(b) from test group by a having tt<2;
ORA-00904: "TT": 标识符无效
SQL> select a tt,sum(b) from test group by a having sum(a)<2;
ok
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/11312660/viewspace-718940/
,如需转载,请注明出处,否则将追究法律责任。