Hi all,
My requirement is as follows
i wan to get hierarchy format of data . we used connectby root and sys connect by path and wrote query but to completly fetch the data it is taking more than 2 hours time, as query is retrieving
lakhs of datafrom table. Is there any alternate method to show the data in hierachy format.please help
create table customer_master (sno number(10),customer_num number(10),prev_customer number(10));
insert into customer_master values(1,101,null);
insert into customer_master values(2,102,101);
insert into customer_master values(3,103,102);
insert into customer_master values(4,200,null);
insert into customer_master values(5,230,200);
format required: 101>102>103
200>230
query:
select customer_num,prev_customer,level,connect_by_root(customer_num)as original_customer,sys_connect_by_path(customer_num,'>')as customer_hierarchy
from(select customer_num,prev_customer from customer_master)
start with prev_customer is null
connect by prior customer_num=prev_customer;
output:-
