Howto retrieve all the grandchildren of all the children

Поиск
Список
Период
Сортировка
От Joost Kraaijeveld
Тема Howto retrieve all the grandchildren of all the children
Дата
Msg-id B9095DA2D217D511929B00A0C94989FE0BD634@obelix.askesis.nl
обсуждение исходный текст
Ответы Re: Howto retrieve all the grandchildren of all the  ("Jeffrey W. Baker" <jwbaker@acm.org>)
Список pgsql-general
I have three tables. Table 1 contains the root of a tree. Table 2 contains
the children of table 1 (column acting as foreign key). Table 3 contains the
children of table 2 (column acting as foreign key). Basically it contains a
three level n-ary tree.

Is it possible to retrieve the grandchildren if I have the primary key of a
record in table 1, assuming that each table has a primary key and an
appropriate foreign key, and if so, what should be the SQL syntax to do so?

TIA

Joost Kraaijeveld


В списке pgsql-general по дате отправления:

Предыдущее
От: Chris "Boz" Jennings
Дата:
Сообщение: Orionserver, CMP and PostgreSQL
Следующее
От: "Jeffrey W. Baker"
Дата:
Сообщение: Re: Howto retrieve all the grandchildren of all the