| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.theory -> Re: pointers on representing tree in db?
David Cressey <david_at_dcressey.com> wrote:
: I've seen a tiny addition to Joe Celko's "nested set" method. This involves
: adding a "level number" column to the hierarchy table. The level number is
: 1 for the root, 2 for the direct children of the root, and so on. So the
: direct children of level N nodes would all have N+1 in the level column.
Another way to do that is to keep tree access queries in stored procs/functions and compute the level inside the function. That's what I did in Postgres when I was trying to emulate Oracle.
Oh, and try not to quote the entire previous article - that Celko bit was quite long.... Received on Wed Apr 18 2001 - 19:13:16 CDT
![]() |
![]() |