개인적인 정리

Oracle GROUP_ID() 본문

DB/ORACLE

Oracle GROUP_ID()

yeon.Biju 2020. 4. 6. 13:12

오라클 GROUP_ID()

 

GROUP_ID()

   - grouping 할 때... group_id 를 숫자로 부여.

   - 음... 처음보지만 필요한 함수다.

 

GROUP_ID()

의 형태

 

GROUP_ID distinguishes duplicate groups resulting from a GROUP BY sepcification. It is useful in filtering out duplicate groupings from the query result. It returns an Oracle NUMBER to uniquely identify duplicate groups. This function is applicable only in a SELECT statement that contains a GROUP BY clause.

 

If n duplicates exist for a particular goupings, then GROUP_ID returns numbers in the range 0 to n-1.

 

 

 

적절한 예는 아니지만.

 

SQL > SELECT MANAGER_ID, GROUP_ID() FROM EMPLOYEES GROUP BY MANAGER_ID; 

 

 

'DB > ORACLE' 카테고리의 다른 글

ORACLE LAST()  (0) 2020.04.06
Oracle INSTR()  (0) 2020.04.06
Oracle INSERTCHILDXML()  (0) 2020.04.06
Oracle INITCAP()  (0) 2020.04.06
Oracle GREATEST()  (0) 2020.03.30
ORACLE FLOOR()  (0) 2020.03.30
ORACLE FIRST()  (0) 2020.03.30
ORACLE EXTRACT()  (0) 2020.03.30
Comments