[重慶思莊每日技術分享]-oracle12c新特性 去重統計函式APPROX_COUNT_DISTINCT

xianhua_33發表於2022-04-27

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部落格 ” ,連結:http://blog.itpub.net/69950318/viewspace-2888991/,如需轉載,請註明出處,否則將追究法律責任。

相關文章