I don't think you can do what you want in one query if you use the adjacency list tree model (i.e. a self join to the parent node). See the article below comparing the adjacency list and the modified preorder tree traversal:

http://www.sitepoint.com/article/1105

I'm not sure if that is what you want or not, but its a good article and worth a shot. For my trees I use a combination of the adjacency list and the modified preorder tree traversal to get the best of both models. Another good reference that compares these two models is "SQL for Smarties" by Joe Celko.

Hope this helps,
Jeremy

_________________________________________________________________
MSN Shopping upgraded for the holidays! Snappier product search... http://shopping.msn.com



-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to