Trees in SQL (again) - Mailing list pgsql-sql

From Bartek Teodorczyk
Subject Trees in SQL (again)
Date
Msg-id 36DD4E78.9BC36320@it.pl
Whole thread Raw
Responses Re: [SQL] Trees in SQL (again)  (jwieck@debis.com (Jan Wieck))
List pgsql-sql
I'm trying to implement set model of trees in SQL and I found a problem:

How to find first level children of parent?

For this structure (with left and right set values):

          1 Jerry 10
              |
     -------------------
     |                 |
 2 Bert 3          4 Chuck 9
                       |
                 ------------
                 |          |
             5 Donna 6  7 Fred 8

The question is: Who is first level child of Jerry?
The answer should produce:
        Bert
        Chuck

BarTeo

pgsql-sql by date:

Previous
From:
Date:
Subject: Undeliverable Message
Next
From: jwieck@debis.com (Jan Wieck)
Date:
Subject: Re: [SQL] Trees in SQL (again)