Re: GetHierarchy

Поиск
Список
Период
Сортировка
От Alban Hertroys
Тема Re: GetHierarchy
Дата
Msg-id 61A3BB1A-6B97-4C8C-8F8F-D25305C7CBB4@gmail.com
обсуждение исходный текст
Ответ на GetHierarchy  (bhanu udaya <udayabhanu1984@hotmail.com>)
Список pgsql-general
On Mar 1, 2013, at 3:18, bhanu udaya <udayabhanu1984@hotmail.com> wrote:

> I need a query to retrieve all the n level hierarchy when a Child node_id is passed. For example; if I pass 7, then i
needparent nodes as below: I want to achive this in postgres database (version 9.2) without connect by prior. 
>
> 3   5
> 5   6
> 6  7
>
> Any reply on this is great help.

You're probably looking for recursive common table expressions:
http://www.postgresql.org/docs/9.2/static/queries-with.html

Alban Hertroys
--
If you can't see the forest for the trees,
cut the trees and you'll find there is no forest.



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

Предыдущее
От: bhanu udaya
Дата:
Сообщение: GetHierarchy
Следующее
От: Raymond O'Donnell
Дата:
Сообщение: Re: Poor performance when using a window function in a view