질의작성

다중 row를 하나의 column에 넣기

by 정만영 posted Mar 13, 2009
다중 row를 하나의 column 에 append 방밥은 아래와 같습니다.

create table test_tbl(a_name varchar(20))
insert into test_tbl values('가나다')
insert into test_tbl values('라마바')
insert into test_tbl values('사아차')
1, select a_name as contents from test_tbl

  contents
======================
  '가나다'
  '라마바'
  '사아차'

2, select A.a_name ||' '|| B.a_name ||' '|| C.a_name as contents
from (select * from test_tbl where rownum=1) A, (select * from test_tbl where rownum=2) B,
(select * from test_tbl where rownum=3) C

  contents
======================
  '가나다 라마바 사아차'

Articles

5 6 7 8 9 10 11 12 13 14