MySQL Forums
Forum List  »  InnoDB

Re: Recursive query
Posted by: Randall Ramirez
Date: July 02, 2008 12:04PM

Saludos Jaime,

I had the same problem with Hierarchies in sql. The problem is more complex when the depth of your structure can be unlimited.

I didn't find a nice way to do it in MYSQL. In your case, if you have fixed depth, you can still using union of union.

But, If you want do something really great I recommend you nested sets. Nested sets are used to represent Hierarchies in relational databases. I changed the structure of my database to use nested sets.

You can find more information right here:

http://dev.mysql.com/tech-resources/articles/hierarchical-data.html

http://www.kamfonas.com/id3.html

Joe Celko is a SQL expert who popularized this solution.

Good Luck.

Options: ReplyQuote


Subject
Views
Written By
Posted
15812
August 15, 2007 12:03PM
Re: Recursive query
7517
July 02, 2008 12:04PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.