-
Contributing Member
Select row by repeating
id no
101 2
102 3
103 1
i need a which is given below. i want to know the comment to know how i wil get this result
101
101
102
102
102
103
-
Expert Member
Re: Select row by repeating
set serveroutput on
declare
id1 varchar2(25);
j number:=0;
begin
for i in (select no from temp)
loop
while j
loop
select id into id1 from temp where no=i.no;
dbms_output.put_line(id1);
j:=nvl(j,0)+1;
end loop;
j:=0;
end loop;
end;
-
Contributing Member
Re: Select row by repeating
declare
id1 varchar2(25);
j number:=1;
begin
for i in (select no from temp)
loop
while j <=i.no loop
select id into id1 from temp where no=i.no;
dbms_output.put_line(id1);
j:=j+1;
end loop;
j:=1;
end loop;
end;
thanks for ur query but some error have came i changed little answer i got .
-
Banned
Re: Select row by repeating
Hi frnd,
Sorry i could not understand which table both of u used to get this result.
pls explain detail y.
Rgds
Ramya
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules