当前位置:Gxlcms > 数据库问题 > oracle中having的使用

oracle中having的使用

时间:2021-07-01 10:21:17 帮助过:18人阅读

在oracle中where关键字是无法和聚合函数一起使用的,having可以让我们筛选分组后的各组数据。

用法:

SELECT column_name, aggregate_function(column_name)
FROM table_name
WHERE column_name operator value
GROUP BY column_name
HAVING aggregate_function(column_name) operator value;

例子:

SELECT
  count_date,
  sum(count_data) count_data
from TB_COUNT_DATA
GROUP BY count_date
HAVING SUM(count_data) > 200;

oracle中having的使用

标签:date   rac   关键字   用法   function   聚合   筛选   having   group by   

人气教程排行