아래에 글 올렸는데 답변이 없어서 고민고민끝에 제가 쿼리를 짜보긴 했는데요. 하고보닌깐 소팅이 문제가 되는데 이게 막막하네요..제가 짠 쿼리 올려보겠습니다.
select ka.cc, ka.dd, ka.gg, ka.hh, oc.new_category_code,
oc.new_category_degree, oc.new_category_item.code,
oc.old_category_code, oc.old_category_degree,
oc.old_category_item_code, oc.new_old_explanation
from (select aa, cc, dd, ee, gg, hh
from (
select aa, cc, dd, ee, gg, hh
from
( select category_name_code as aa,
category_degree as bb,
category_code as cc,
category_code_name as dd
from category_code
where category_name_code = '001'
and category_degree = '09') a,
( select category_name_code as ee,
category_degree as ff,
category_code as gg,
category_code_name as hh
from category_code
where category_name_code = '001'
and category_degree = '08') a,
where a.aa = b.ee(+)
and a.cc = b.gg(+)
union
select aa, cc, dd, ee, gg, hh
from
( select category_name_code as aa,
category_degree as bb,
category_code as cc,
category_code_name as dd
from category_code
where category_name_code = '001'
and category_degree = '08') a,
( select category_name_code as ee,
category_degree as ff,
category_code as gg,
category_code_name as hh
from category_code
where category_name_code = '001'
and category_degree = '09') a,
where a.ee = b.aa(+)
and a.gg = b.cc(+)
)
order by aa, gg) ka, old_connection_table oc
where ka.aa = oc.new_category_code(+)
and ka.cc = oc.new_category_item_code(+)
and ka.ee = oc.old_category_code(+)
and ka.hh = oc.old_category_item_code(+);
이렇게 짜보았는데요 일단 결과가 맞긴 한것 같은데
소팅순서에 문제가 있네요...ㅠㅠ
양쪽다 동일한 코드가 존재할경우엔 한 로우에 나오는데
서로 다른 코드는 09차인쪽 우선순위로 찍고
09차 데이타가 끝나면 오른쪽에 08차데이터를 찍는 순인데
아래에서 제가 말씀드린것처럼 코드순서대로 데이터를 출력할수는
없을까요?
고수님들에 답변이 절실할게 필요합니다..ㅠㅠ 도와주세요...