select
a.a,
a.b,
a.c
from
(
select a.a,a.b,a.c from
(
select 'a' a , 'b1' b , '' c from dual
union
select 'a' a , 'b2' b , '' c from dual
union
select 'a' a , 'b3' b , '' c from dual
union
select 'a' a , 'b4' b , '' c from dual
union
select 'b' a , 'b5' b , '' c from dual
union
select 'b' a , 'b6' b , '' c from dual
) a
union
select b.a,b.b,b.c from
(
select 'a' a , '' b , 'c1' c from dual
union
select 'a' a , '' b , 'c2' c from dual
union
select 'b' a , '' b , 'c3' c from dual
union
select 'b' a , '' b , 'c4' c from dual
union
select 'b' a , '' b , 'c5' c from dual
) b
) a
a |
b1 |
|
a |
b2 |
|
a |
b3 |
|
a |
b4 |
|
a |
|
c1 |
a |
|
c2 |
b |
b5 |
|
b |
b6 |
|
b |
|
c3 |
b |
|
c4 |
b |
|
c5 |
위 데이타를 아래와 같이 표현하고 싶습니다.
a |
b1 |
c1 |
a |
b2 |
c2 |
a |
b3 |
|
a |
b4 |
|
b |
b5 |
c3 |
b |
b6 |
c4 |
b |
|
c5 |
sql를 어떻게 구현해야 할까요?
조언 부탁드립니다..ㅜㅜ
|