Nested Set - Depth of a Sub-Tree - Active Record |
[eluser]Otemu[/eluser]
Hi, After reading the excellent managing hierarchical data in mysql I was wondering if anyone knows how to write the query below in active record or if it even possible with AR: Code: SELECT node.name, (COUNT(parent.name) - (sub_tree.depth + 1)) AS depth Since all my queries currently in AR be nice to continue that trend, however if not then I guess I have to run this one as standard mysql. Any help be appreciated. |
Messages In This Thread |
Nested Set - Depth of a Sub-Tree - Active Record - by El Forum - 10-10-2012, 05:44 AM
Nested Set - Depth of a Sub-Tree - Active Record - by El Forum - 10-10-2012, 05:51 AM
Nested Set - Depth of a Sub-Tree - Active Record - by El Forum - 10-10-2012, 07:29 AM
|