MySQL Forums
Forum List  »  General

Re: Modified Preorder Tree Traversal - Advanced question
Posted by: Roland Bouman
Date: August 31, 2005 02:52AM

Clive Galway wrote:
> I have a demo of the latest version up now !
> See your lovely query in action :)
>
> http://free-host.no-ip.org/clive

Good to hear it. I glanced over it quickly, and I'll check it out in full later on today.
>
> I made your query a subquery on the locations
> table like:

Ok, BTW, i commented the query in full in your wiki page

> the children of the selected region, I just use
> the parent_id of the region (Is it bad to have an
> adjacency list parent_id AND nested set lft, rgt
> fields ?)

I don't know if it's bad. I've had some thoughts on this myself. Check out the post of
Wednesday, August 24, 2005 on my blog

http://rpbouman.blogspot.com

> I have another question...
> How would I modify that query to add an extra
> field on the end of the returned data that
> included a COUNT of all locations in that region
> (the table xmb_gm_locations has a region_id field
> in it)
> Ideally the field should contain the number of
> locations in that region and it's child regions.
> (ie for the row UK, it should contain a count of
> all locations with a region id that is a child of
> UK, not just in the UK region itself)
>
> I tried solving this one for like 5 or 6 hours,
> fried my brain and gave up :(

Not to worry. I'll look into it tonight when I get home from work. Others: feel free to contribute, I'm making long workdays lately ;-).

Options: ReplyQuote


Subject
Written By
Posted
Re: Modified Preorder Tree Traversal - Advanced question
August 31, 2005 02:52AM


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.