Note:
The APPROX_COUNT_DISTINCT function is available starting with Oracle Database 12c Release 1 (12.1.0.2).
用例:
求scott.emp表中一共有多少个部门
11g:
SELECT COUNT(DISTINCT deptno) AS cnt FROM scott.emp
12c:
SELECT APPROX_COUNT_DISTINCT(deptno) AS cnt FROM scott.emp
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/69950318/viewspace-2888991/ ,如需转载,请注明出处,否则将追究法律责任。