Subject Re: [firebird-support] Re: Tree Sql query
Author Martijn Tonies
> Can we achieve the same in a single sql query?

http://www.intelligententerprise.com/001020/celko.jhtml?_requestid=203273

With regards,

Martijn Tonies
Database Workbench - developer tool for InterBase, Firebird, MySQL & MS SQL
Server.
Upscene Productions
http://www.upscene.com


> Regards,
> Siva
>
> bit akkiwed ub
> --- In firebird-support@yahoogroups.com, "Martijn Tonies"
> <m.tonies@u...> wrote:
> > Hi,
> >
> > > I have tree structure in my application and i need to write a
> sql
> > > for this tree structure.
> > > 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
> & MS SQL
> > Server.
> > Upscene Productions
> > http://www.upscene.com
>
>
>
>
> Yahoo! Groups Links
>
>
>
>