Trees in SQL (again)

From: Bartek Teodorczyk <barteo(at)it(dot)pl>
To: pgsql-sql(at)postgresql(dot)org
Subject: Trees in SQL (again)
Date: 1999-03-03 15:00:08
Message-ID: 36DD4E78.9BC36320@it.pl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Jan Wieck 1999-03-03 15:25:17 Re: [SQL] Trees in SQL (again)
Previous Message MAILER-DAEMON 1999-03-03 04:44:58 Undeliverable Message