Hi,

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

thanks
J