Re: SOLVED: Emulating 'connect by prior' using stored proc - Mailing list pgsql-sql

From Merrall, Graeme
Subject Re: SOLVED: Emulating 'connect by prior' using stored proc
Date
Msg-id B7AD8B4B4A337741B62E633B4827ADD932D5CD@svrexc02.aolau.ops.au.office.aol.com
Whole thread Raw
In response to SOLVED: Emulating 'connect by prior' using stored proc  ("Merrall, Graeme" <gmerrall@team.aol7.com.au>)
List pgsql-sql


>         I have one question because I'm not clear about
> something with your
> implementation (a good one too by the looks of it -- thanks
> for sharing
> this information); if I start my query from an item at level
> 5, will the
> level be reflected as such, or will it dynamically start at 1?
>
>         As I understand it, in Oracle the level would begin at
> 1 in this case.
>

It's the same in this case. The tree building stuff only ever looks down
so the level returned in the query results will start at 1 no matter
where you enter your tree.  In our case we could enter the tree at
'node' 100 and get the tree below that but the function will start at 1
because we only interested in the data below not the entry point and not
where in the tree we entered.

As in the solution if you really want to start it at 5 then set that as
the value of your second parameter.

Cheers,Graeme


pgsql-sql by date:

Previous
From: Abdul Wahab Dahalan
Date:
Subject: Need Help : Query problem
Next
From: Greg Stark
Date:
Subject: Re: Expressional Indexes