MySQL Forums
Forum List  »  Newbie

Re: recursive query in a product catalog tree?
Posted by: Jay Pipes
Date: August 07, 2005 10:41PM

peter michaux wrote:
> Is there a single step query that will do this?

Yes, but only if you have already determined the depth of the tree. And that query is quite cumbersome. If you want fast, efficient, tree-based SQL, use the nested set model, made popular by Joe Celko. Mike Hillyer has written a good tutorial on this in MySQL, and it is also covered in my book. (I know, blatant self-promo). I would explain it here, but it's involved and would consume quite a bit of time :)

Jay Pipes
Community Relations Manager, North America, MySQL Inc.

Got Cluster? http://www.mysql.com/cluster
Personal: http://jpipes.com

Options: ReplyQuote


Subject
Written By
Posted
Re: recursive query in a product catalog tree?
August 07, 2005 10:41PM


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.