作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我一直在通过一些 sql 语法来学习 oracle sql 考试,我发现一些相当困惑的东西
基于 official引用,选择语法如下:
SELECT
[ hint ]
[ { { DISTINCT | UNIQUE } | ALL } ]
select_list
FROM { table_reference | join_clause | ( join_clause ) }
[ , { table_reference | join_clause | (join_clause) } ] ...
[ where_clause ]
[ hierarchical_query_clause ]
[ group_by_clause ]
[ HAVING condition ]
[ model_clause ]
select
department_id , count (*)
from
employees
having
count(*) > 6
group by
department_id ;
最佳答案
如前所述 here :
Use the HAVING clause to restrict the groups of returned rows to those groups for which the specified condition is TRUE. If you omit this clause, then the database returns summary rows for all groups.
Specify GROUP BY and HAVING after the where_clause and hierarchical_query_clause. If you specify both GROUP BY and HAVING, then they can appear in either order.
关于sql - oracle sql 选择语法与 GROUP BY 和 HAVING 子句,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20188862/
我是一名优秀的程序员,十分优秀!