Study/DB

Oracle 다중 Row 를 한개의 Row 로 변형

LoonyHyun 2014. 3. 14. 15:40
반응형

Oracle 10g 이상에서 가능하다고 한다.




XMLAGG 이용

- http://docs.oracle.com/cd/B19306_01/server.102/b14200/functions215.htm


    : 생략 가능


SELECT SUBSTR(XMLAGG(XMLELEMENT(x, ',', {컬럼명}) ORDER BY {컬럼명}).EXTRACT ('//text()'), 2)

FROM {테이블명};




WMSYS 이용

- ORACLE WIKI 내용

Purpose:

The account used to store the metadata information for Oracle Workspace Manager.

Safe To Remove:

Yes

Recreation Script:

$ORACLE_HOME/rdbms/admin/owmctab.plb


- http://www.idevelopment.info/data/Oracle/DBA_tips/Database_Administration/DBA_26.shtml 

Used to store all the metadata information for Oracle Workspace Manager. This user was introduced in Oracle9i and (like most Oracle9i supporting accounts) is locked by default. The user account is locked because we want the password to be public but restrict access to the account to the SYS schema. So, to unlock the account, DBA privileges are required. 


SELECT WMSYS.WM_CONCAT( {컬럼명} )

FROM {테이블명};