2025. 3. 9. 21:34 IT/MySQL
[오라클] 스칼라서브쿼리에서 컬렉션(Multirow) 사용
[오라클] 스칼라서브쿼리에서 컬렉션(Multirow) 사용
참고 URL = http://scidb.tistory.com/69
아래 순서대로 하면 됩니다.
create or replace type dept_type as object
(
dept_cd char(10),
dept_nm name varchar2(50)
);
create or replace type array_dept as varray(100) of dept_type;
select *
from (
select a.id
,a.name
,cast(multiset (select dept_cd
dept_nm
from dept b
where b.dept_cd = a.dept_cd
) as array_dept
) as dept_info
from member a
);
'IT > MySQL' 카테고리의 다른 글
Mysql MyISAM과 InnoDB 차이점. (0) | 2021.02.08 |
---|---|
[MySQL 튜닝] 대용량 테이블의 성능에 영향을 줄일 수 있는 10가지 방법 (0) | 2018.08.16 |
MySQL 파일 위치. (0) | 2018.08.16 |
mysql order by field (0) | 2018.03.29 |
MyISAM, InnoDB 비교 (0) | 2018.01.30 |