OracleAggregate FunctionsGROUPING
REGR_SLOPE

GROUPINGAggregate Functions

APPROX_COUNT_DISTINCT

Returns whether a row is aggregated by ROLLUP/CUBE.

Syntax

GROUPING(expr)

Example

Enter values below to update the example in real time.

department_id
job_id
salary
grp_dept
employees
SELECT department_id, job_id,
       SUM(salary),
       GROUPING(department_id) AS grp_dept
FROM employees
GROUP BY ROLLUP (department_id, job_id);