在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;

相关文章:

  • 2021-10-01
  • 2022-12-23
  • 2022-02-20
  • 2022-12-23
  • 2022-12-23
  • 2021-08-23
  • 2021-09-06
猜你喜欢
  • 2022-12-23
  • 2022-01-26
  • 2021-11-29
  • 2022-12-23
  • 2022-02-22
  • 2022-02-20
相关资源
相似解决方案