2006 8:20 AM
To: André Hänsel
Cc: mysql@lists.mysql.com
Subject: Re: AW: Count of children
André
With an edge list, the solution entails recursion, so you need either an sproc
or application proc. With a nested sets model, the count is dead simple. If the
id of the target row is N, and the
André
With an edge list, the solution entails recursion, so you need either
an sproc or application proc. With a nested sets model, the count is
dead simple. If the id of the target row is N, and the left & right
node columns are named leftedge and rightedge, the query is
SELECT COUNT(t2.id)
I've found this website to be extremely helpful:
http://www.artfulsoftware.com/mysqlbook/sampler/mysqled1ch20.html
Donna DeVaudreuil
André Hänsel <[EMAIL PROTECTED]>
09/27/2006 10:55 AM
To
<[EMAIL PROTECTED]>
cc
Subject
AW: Count of children
I will use any model that is suitable. ;)
André
> Sorry, my english sentence was imprecise. :) I want the count of all
> sub-entries AND THEIR sub-sub-entries.
Example:
A
/ \
B C
/ \
D E
\
F
So I want to know that C has 3 sub-nodes.
Aha! I thought it seemed like an easy question ;-)
As far as i know, the onl