MySQL Forums
Forum List  »  Newbie

Re: Return the level and count of a closure table.
Posted by: Sam Holmes
Date: May 07, 2009 05:31PM

SELECT depth AS level, COUNT(level) AS count
FROM my_tree 
WHERE ancestor_id = 1
GROUP BY depth

WORKS! Finally I've gotten this done. I don't know how many hour I spent trying to figure this out.

I must say thank you, very, very much for all the help on this!

If there's anything you might want to add, go for it.

Options: ReplyQuote




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.