Re: Count of children

2006-09-27 Thread Douglas Sims
ch, 27. September 2006 15:48 An: André Hänsel; mysql@lists.mysql.com Betreff: re: Count of children André, Your sentence 'I want the count of all sub-entries for a specific entry' converts straight into SQL: 'I want' SELECT the count of all entries COUNT(*) FROM myT

Re: Count of children

2006-09-27 Thread Peter Brawley
André, I want the count of all sub-entries for a specific entry. Depends on the model you are using--edge list or nested sets? PB - André Hänsel wrote: I have a table with id and parent_id. I want the count of all sub-entries for a specific entry. I found several documents about worki

Re: Count of children

2006-09-27 Thread Jo�o C�ndido de Souza Neto
-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] > Gesendet: Mittwoch, 27. September 2006 15:48 > An: André Hänsel; mysql@lists.mysq

re: Count of children

2006-09-27 Thread Rob Desbois
André, Your sentence 'I want the count of all sub-entries for a specific entry' converts straight into SQL: 'I want' SELECT the count of all entries COUNT(*) FROM myTable with a specific parent WHERE parent_id = 5 You've missed one of the major benefits of SQL - it's designed to rea

Re: Count of children

2006-09-27 Thread Jo�o C�ndido de Souza Neto
You can use it: SELECT parent_id, count( * ) FROM table WHERE parent_id =1 GROUP BY parent_id It´ll works fine. ""André Hänsel"" <[EMAIL PROTECTED]> escreveu na mensagem news:[EMAIL PROTECTED] I have a table with id and parent_id. I want the count of all sub-entries for a specific entry. I