Обсуждение: hierarchical order equivalent

Поиск
Список
Период
Сортировка

hierarchical order equivalent

От
"Grant Furick"
Дата:
Is there an equivalent way to do this Oracle query in Postgres?
Select category_id, parent_category_id, category_nameFROM CategorySTART WITH category_id = 6CONNECT BY PRIOR
category_id= parent_category_idOrder by category_name
 


I am trying to build a hierarchy of inter-related categories.  I want an
easy way to output the tree.  Any ideas?

Thanks,
Grant




Re: hierarchical order equivalent

От
Karel Zak
Дата:
On Sun, Mar 18, 2001 at 06:56:17PM -0500, Grant Furick wrote:
> Is there an equivalent way to do this Oracle query in Postgres?
> 
>  Select category_id, parent_category_id, category_name
>  FROM Category
>  START WITH category_id = 6
>  CONNECT BY PRIOR category_id = parent_category_id
>  Order by category_name
> 
The PostgreSQL hasn't implemented Oracle's "walk tree" feature (yet??? 
-- speculate about it anyone?). If I good remember some discussion about 
hierarchy system in tables was before now, see archives at postgresql.org.
    Karel


-- Karel Zak  <zakkr@zf.jcu.cz>http://home.zf.jcu.cz/~zakkr/C, PostgreSQL, PHP, WWW, http://docs.linux.cz,
http://mape.jcu.cz