Hi
am try to above query but did not work.
i try my level best but its not work properly.
create table person1(p_id number(2),p_name varchar2(10),email varchar2(10),phone number(5));
insert into person1 values (&p_id,'&p_name','&eamil',&phone);
P_ID P_NAME EMAIL PHONE CHILD1 CHILD2 CHILD3
1 rar rah@mail 2525 rajesh suresh balaji
select * from person1
;
delete from person1 where p_id='23';
alter table person1 add child1 varchar2(10) add child2 varchar2(10) add child3 varchar2(10);
update person1 set child1='rajesh',child2='suresh',child3='balaji' where p_id='1';
with temp as (
select p_id,child1+','+child2+','+child3 as Childs
from person1
)
SELECT p_id,ROW_NUMBER() OVER(PARTITION BY p_id ORDER BY p_id) as seqno
,trim(regexp_substr(str, '[^,]+', 1, level)) str
FROM (SELECT p_id, Childs FROM temp) t
CONNECT BY instr(Childs, ',', 1, level - 1) > 0
ORDER BY p_id;
rajesh.plsql123@gmail.com
Rajesh123, if this helps please login to Mark As Answer. | Alert Moderator