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
I will use any model that is suitable. ;)
I am somewhat familiar with both tree models but I can't come up with a
method to get the count of all sub- and sub-sub-nodes in either of them.
> -Ursprüngliche Nachricht-
> Von: Peter Brawley [mailto:[EMAIL PROTECTED]
> Gesendet: Mittwoch, 27.
http://www.messagelabs.com/email
__
<
-- Original Message --
FROM: André Hänsel<[EMAIL PROTECTED]>
TO:"'Rob Desbois'" <[EMAIL PROTECTED]>
DATE: Wed, 27 Sep 2006
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.
> -Ursprüngliche Nachricht-
> Von: Rob Desbois [mailto:[EMAIL PROTECTED]