重庆思庄Oracle、Redhat认证学习论坛

标题: oracle12c新特性 去重统计函数APPROX_COUNT_DISTINCT [打印本页]

作者: 郑全    时间: 2016-10-16 17:59
标题: oracle12c新特性 去重统计函数APPROX_COUNT_DISTINCT
Note:
The APPROX_COUNT_DISTINCT function is available starting with Oracle Database 12c Release 1 (12.1.0.2).

用例:
求scott.emp表中一共有多少个部门
1

2

3

4

5

6

7

11g:


SELECT COUNT(DISTINCT deptno) AS cnt FROM scott.emp


12c:


SELECT APPROX_COUNT_DISTINCT(deptno) AS cnt FROM scott.emp









欢迎光临 重庆思庄Oracle、Redhat认证学习论坛 (http://bbs.cqsztech.com/) Powered by Discuz! X3.2