Results 1 to 4 of 4

Thread: Select row by repeating

  1. #1
    Contributing Member
    Join Date
    Jul 2007
    Answers
    42

    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


  2. #2
    Expert Member
    Join Date
    Apr 2007
    Answers
    500

    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;


  3. #3
    Contributing Member
    Join Date
    Jul 2007
    Answers
    42

    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 .


  4. #4
    Banned
    Join Date
    Jun 2008
    Answers
    3

    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
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact