sys_connect_by_path 대신 wm_concat 사용.
성능은 모르겠지만.. 일단 편하다..!!!!
select bb_uid, substr(max(sys_connect_by_path(contents, ',')), 2) as contents
from (
select bb_uid, contents, row_number() over (partition by bb_uid order by seq) as rnum
from aps_bbs_contents
)
start with rnum = 1
connect by prior rnum = rnum - 1 and prior bb_uid = bb_uid
group by bb_uid
order by bb_uid;
------------------------------------------------------------------------------------------------------------------------
select bb_uid, wm_concat(contents) as contents
from aps_bbs_contents
group by bb_uid;
'프로그래밍 > Database' 카테고리의 다른 글
tomcat + spring + iBatis JNDI 설정 (0) | 2012.11.30 |
---|---|
오라클 데이터 복구 (0) | 2012.11.30 |
ibatis 멀티 property (0) | 2012.10.29 |
pivot xml (0) | 2012.10.25 |
오라클 11g pivot (0) | 2012.10.16 |