select a,
max(case when b=1 then c end),
max(case when b=1 then d end),
max(case when b=1 then e end),
max(case when b=2 then c end),
max(case when b=2 then d end),
max(case when b=2 then e end),
max(case when b=3 then c end),
max(case when b=3 then d end),
max(case when b=3 then e end)
from
(
select 11350 as a, 1 as b, 631140 as c, 'F' as d ,20081217 as e from dual
union all
select 11350 as a, 2 as b, 064088 as c,'F' as d,20081218 as e from dual
union all
select 11350 as a, 3 as b, 973033 as c, 'F' as d, 20081219 as e from dual
)
group by a
이렇게 하면 되겠죠...
by 강근삼
[2008.12.17 20:43:20]
위 방법은, 123부분이 항상 맨앞에 11350에 대해서 1,2,3 값만을 가진다면
여러개 되도 사용할 수는 있습니다만,