Re: [sqlite] All ancestors / descendents of a vertex in sqlite?

2010-03-18 Thread Jean-Christophe Deschamps
>I have a (small) directed graph which I would be able to fins all >ancestors or descendents of a certain vertex (transitive closure?). >So, using this graph: > >CREATE TABLE levels_levels (parent_id INTEGER ,child_id INTEGER, >UNIQUE(parent_id, child_id)); >INSERT INTO "levels_levels"

Re: [sqlite] All ancestors / descendents of a vertex in sqlite?

2010-03-18 Thread Jay A. Kreibich
On Thu, Mar 18, 2010 at 10:05:20AM +0100, Fredrik Karlsson scratched on the wall: > Dear list, > > I have a (small) directed graph which I would be able to fins all > ancestors or descendents of a certain vertex (transitive closure?). > So, using this graph: > > CREATE TABLE levels_levels

Re: [sqlite] All ancestors / descendents of a vertex in sqlite?

2010-03-18 Thread Simon Slavin
On 18 Mar 2010, at 9:05am, Fredrik Karlsson wrote: > I would like to make it possible to find 10 as a descendent of 8 and 6 > as a parent of 9 (for instance). > I have found a couple of procedural solutions using procedural calls > in sql server or postgresql, but is there a solution that I

[sqlite] All ancestors / descendents of a vertex in sqlite?

2010-03-18 Thread Fredrik Karlsson
Dear list, I have a (small) directed graph which I would be able to fins all ancestors or descendents of a certain vertex (transitive closure?). So, using this graph: CREATE TABLE levels_levels (parent_id INTEGER ,child_id INTEGER, UNIQUE(parent_id, child_id)); INSERT INTO "levels_levels"