Subject | Re: Tree Sql query |
---|---|
Author | sivram_kr |
Post date | 2004-03-22T09:22:28Z |
Can we achieve the same in a single sql query?
Regards,
Siva
bit akkiwed ub
--- In firebird-support@yahoogroups.com, "Martijn Tonies"
<m.tonies@u...> wrote:
Regards,
Siva
bit akkiwed ub
--- In firebird-support@yahoogroups.com, "Martijn Tonies"
<m.tonies@u...> wrote:
> Hi,sql
>
> > I have tree structure in my application and i need to write a
> > for this tree structure.& MS SQL
> > This is my scneario.
> >
> > Nod_id Parent_node_id level_id
> >
> > 1001 1001 1
> > 1002 1001 2
> > 1003 1001 2
> > 1004 1002 3
> > 1005 1002 3
> > 1006 1003 3
> > 1007 1003 3
> >
> > If i say node_id=1002, i should get all the nodes under 1002 and
> > 1002.My output should be 1002,1004,1005 like this.
>
> Try a recursive selectable stored procedure.
>
> With regards,
>
> Martijn Tonies
> Database Workbench - developer tool for InterBase, Firebird, MySQL
> Server.
> Upscene Productions
> http://www.upscene.com