I would like to use a example query for retrieving a full tree of the nested set model in a dynamic query.
SELECT node.name
FROM nested_category AS node,
nested_category AS parent
WHERE node.lft BETWEEN parent.lft AND parent.rgt
AND parent.name = 'ELECTRONICS'
ORDER BY node.lft;
The problem is that dynamic queries can't alias the same table. Is there a work around for this?
parent.name
... or add otherJoins
... then that's what dynamic queries are for. Dynamic queries are easier to build APIs with, or allow flexability in a library.