PL/SQL Recursion? Forums - Powered by vBulletin
Results 1 to 2 of 2

Thread: PL/SQL Recursion?

  1. #1
    Join Date
    Nov 2007

    PL/SQL Recursion?


    I am not sure if recursion is the solution. But here is my issue.
    I have to do this only in the backend procedure and in Ora 91

    I have a teacher and he has a class he is teaching. I want to know all the students who are taking that class only glitch is the students themselves might be taking some class and I want the students of the class the students are teaching.

    i hope i am clear and not confusing you people

    i have 2 relations

    teacher-class table which has teacherid, classid
    class-student table which has classid, studentid

    in this say if teacher John teaches math and students A, B,C are enrolled in math.
    in turn A might teach science , B might teach history. in the science class which A teaches there might be students E,F,G

    So i want all the users if I pass John as teh parameter I should get
    A,B,C,E,F,G...But I should not get John again if he is enrolled in A's science class

    I am at loss now as to which way to go.
    Can you please help.

    I have modified my original requirement into a more readable example . pls let me know how to approach this issue. i am going nuts


  2. #2
    Join Date
    Jun 2000
    Madrid, Spain
    not sure but you might look at hierachrical SQL queries, i.e Connect By

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Click Here to Expand Forum to Full Width