logic/db question

Поиск
Список
Период
Сортировка
От bruce
Тема logic/db question
Дата
Msg-id 0c7201c6b665$1cf0e7e0$0301a8c0@Mesa.com
обсуждение исходный текст
Ответы Re: logic/db question  ("Merlin Moncure" <mmoncure@gmail.com>)
Re: logic/db question  ("Marco Bizzarri" <marco.bizzarri@gmail.com>)
Список pgsql-general
hi...

i have a tbl
 fooTBL
   name
   parentID
   ID

so a name can have might have a parentID, as well as an ID. 'name's are
associated with other 'name's via the parentID. in other words, if a name's
parentID == a name's ID, name1 is the parent of name2.

  name    parentID     ID
  foo         -        1
  cat        1        2
  dog      2        3

my question, how can i come up with a sql query that will list all the
children (and children's children...) of a top level item?

i had done this awhile ago.. but can't recall how i did it..

thanks



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

Предыдущее
От: "Thomas F. O'Connell"
Дата:
Сообщение: PostgreSQL on RAM Disk / tmpfs
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: Best Procedural Language?