John
Answered On : Jun 24th, 2005
Recursive relationships are an interesting and more complex concept than the relationships you have seen in the previous chapters, such as a one-to-one, one-to-many, and many-to-many. A recursive relationship occurs when there is a relationship between an entity and itself. For example, a one-to-many recursive relationship occurs when an employee is the manager of other employeess. The employee entity is related to itself, and there is a one-to-many relationship between one employee (the manager) and many other employees (the people who report to the manager). Because of the more complex nature of these relationships, we will need slightly more complex methods of mapping them to a schema and displaying them in a stylesheet.

1 User has rated as useful.
Login to rate this answer.
ritwik roy
Answered On : Jul 21st, 2005
using the concept of self join may be a solution to this problem. e.g if a table called employees contains three fields like emp_id,name and manager_id and we will have to find out the name of the manager for each employee, then we can use the following code
select a.name,b.name
from employees a, employees b
where a.manager_id=b.emp_id
Login to rate this answer.
Jeetendra Nalawade
Answered On : Nov 12th, 2007
We have used a different way of maintaning recursive relationship. We have created a ancestry table which will give the childs for each entry upto n th level. This way you can fire queries directly to get the child upto any specific level.

1 User has rated as useful.
Login to rate this answer.