Hierarchical query's

From: Cláudia Morgado <claudia(dot)morgado(at)widesoft(dot)com(dot)br>
To: <pgsql-general(at)postgresql(dot)org>
Cc: <cmmello(at)wide(dot)com(dot)br>
Subject: Hierarchical query's
Date: 2003-10-23 15:58:48
Message-ID: 012001c3997e$8be9f300$15011aac@widesoft.com.br
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello!

Oracle has the option with the SQL CONECT BY statement to run through a hierarchical database with a single SQl-statement:

<!--SQL SELECT ms_id,ms_parent FROM messages CONNECT BY PRIOR ms_id = ms_parent START WITH ms_id = 1 -->

Result-set (example):

ms_id parent_id 1 1.1 1 1.1.1 1.1 1.1.2 1.1 1.1.3 1.1 1.2 1 1.2.1 1.2

etc

I need to do this in PostgreSql.

This is possible in the Postgre?

regards,
Cláudia Morgado and Carla Mello

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ron 2003-10-23 16:02:03 Nullable 'Foreign Key-like' Constraint
Previous Message scott.marlowe 2003-10-23 15:40:08 Re: database files