recursive query?

Поиск
Список
Период
Сортировка
От CSN
Тема recursive query?
Дата
Msg-id 20040202215436.2850.qmail@web40609.mail.yahoo.com
обсуждение исходный текст
Ответы Re: recursive query?
Список pgsql-general
I have a table with these columns:

id, node, parent_node_id

The top-most nodes would have a parent_node_id of
NULL. Is it possible to get a node, and all its parent
nodes, in a single query?

For example, a node might be:

books > computers > databases > oss > postgres

and the rows fetched would be:

1,books,NULL
2,computers,1
3,databases,2
4,oss,3
5,postgres,4

TIA,
CSN



__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free web site building tool. Try it!
http://webhosting.yahoo.com/ps/sb/

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