Nope. That works for very small trees (single nodes). But as soon as you get
multiple child nodes, it messes up.
Category        LVL        LFT        RGT
Parent 1            1            1            10
ABC child          2            6            9
Child 1                2            2            5
A child of child1    3            3            4
AB child of abc ch   3            7            8

I know it has to be done on the front-end (on insert). Just not sure the
best way to go about it. I'm working on an end-user tool for explicitly
placing nodes.

-d

----- Original Message -----
From: "Janet Schmitt"
> Deanna -
>
> A little late in the discussion, but what are you trying to sort by?
>
> If is it category, how about this?
>
> SELECT child.category, COUNT(child.lft) AS lvl, child.lft, child.rgt,
> child.categoryid
> FROM category  parent, category  child
> WHERE child.lft BETWEEN parent.lft AND parent.rgt
> GROUP BY child.lft, child.rgt, child.category, child.categoryid
> ORDER BY lvl, child.category
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to