위 사진처럼 여러개의 행을 하나의 행으로 표현하기
with school as (
select '1' as grade,'1' as class, '홍길동(1)' as name, 70 as score from dual union all
select '1','1','홍길동(4)',10 from dual union all
select '2','1','홍길동(5)',50 from dual union all
select '2','1','홍길동(7)', 15 from dual union all
select '2','2','홍길동(8)',90 from dual union all
select '3','1','홍길동(2)',54 from dual union all
select '3','1','홍길동(6)',60 from dual union all
select '3','2','홍길동(3)',72 from dual union all
select '3','2','홍길동(9)',0 from dual
) SELECT array_to_string(array_agg(name),',') from school;
// array_to_string(array_agg('컬럼명'),'구분자')
select array_to_string(array_agg(column),',') from daul;
[DATABASE/POSTGRESQL] 특정 패턴의 String값 Array로 반환하 (0) | 2020.05.25 |
---|---|
[DATABASE] SELECT 한 데이터 INSERT하기 INSERT INTO SELECT (0) | 2020.04.02 |
[DATABASE>PL/SQL] 오라클 / POSTGRESQL 패키지 생성하기 (0) | 2020.03.04 |
[POSTGRESQL] 문자 암호화 (0) | 2020.03.03 |
[ORACLE] TABLESPACE 생성/삭제/수정/조회 (0) | 2020.02.24 |
댓글 영역