Re: Heirarchical Data Structures. MS Access. Together?

From: --CELKO-- <joe.celko_at_northface.edu>
Date: 28 Jul 2003 09:54:14 -0700
Message-ID: <a264e7ea.0307280854.61d7d42f_at_posting.google.com>


>> one should not allow removal of a parent (i.e. someone that has
children)... any parent has (right - left - 1) / 2 = number of children. <<

I usually use (lft = rgt -1) to detect leaf nodes. If there is an index on (lft, rgt) or just (lft), the speed is pretty good.

 DELETE FROM Tree
 WHERE lft = rgt -1
   AND <<other conditions>>; Received on Mon Jul 28 2003 - 18:54:14 CEST

Original text of this message