Quick Search:
CODE
Oracle PL/SQL Code Library
JOBS
Find Or Post Oracle Jobs
FORUM
Oracle Discussion & Chat
 The Oracle PL/SQL GROUP_ID Function      [Return To Index] Jump to:  
  Looking for the original pages? (formerly called "Morgan's Library") You can find them here.

Term: GROUP_ID

Definition:
The Oracle GROUP_ID function uniquely identifies a group of rows which has been created by GROUP BY clause in the query result set. It generates a number for a group to distinguish the duplicate groups. For 'n' duplicate groups, GROUP_ID can attain value from 0 to n-1 to number the groups.

Note that the function does not accept any parameters and these numbers are unique for each set of duplicate groups.

The GROUP_ID function is usable only in a SELECT statement that contains a GROUP_BY clause.

A unique group is assigned zero, while duplicate groups (if any) are assigned values greater than zero.

Example Syntax:

GROUP_ID()


Example Usage:

SELECT DEPTNO, JOB_ID, COUNT(*), GROUP_ID ()
FROM EMPLOYEE
GROUP_BY DEPTNO, ROLLUP(DEPTNO, JOB_ID)


Related Links:
 
Home      :      Code Library      :      Sponsors      :      Privacy      :      Terms of Use      :      Contact Us 250 users online    © 2009 psoug.org
PSOUG LOGIN
Username: 
Password: 
Forgot your password?