is it for oracle or sqlserver? if oracle youre in luck, they have the "connect by prior" keyword that can output this result in one sql statement. for sql server, you might need execute a series of dynamic sql inside a stored procedure.
--- Charles Parks <[EMAIL PROTECTED]> wrote: > What would be the select statement for choosing the > children that belong > to a parent when a child can have children? > > Sample table data > > Parent | Child |... > ------------------ > Books |Awards | > Awards|5Year | > Awards|Admin | > Awards|25Year | > 5Year |Pictures | > 5Year |Worksheet | > Admin |Pins | > Admin |Floor Plans | > ... > > The desired select statement should then return > something like > Books\Awards\5Year\Pictures > Books\Awards\5Year\WorkSheet > Books\Awards\Admin\Pins > Books\Awards\Admin\Floor Plans > __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com ------------------------ Yahoo! Groups Sponsor --------------------~--> <font face=arial size=-1><a href="http://us.ard.yahoo.com/SIG=12hfimhja/M=362335.6886445.7839731.1510227/D=groups/S=1705115364:TM/Y=YAHOO/EXP=1124248202/A=2894361/R=0/SIG=13jmebhbo/*http://www.networkforgood.org/topics/education/digitaldivide/?source=YAHOO&cmpgn=GRP&RTP=http://groups.yahoo.com/">In low income neighborhoods, 84% do not own computers. At Network for Good, help bridge the Digital Divide!</a>.</font> --------------------------------------------------------------------~-> '// ======================================================= Rules : http://ReliableAnswers.com/List/Rules.asp Home : http://groups.yahoo.com/group/vbHelp/ ======================================================= Post : [email protected] Join : [EMAIL PROTECTED] Leave : [EMAIL PROTECTED] '// ======================================================= Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/vbhelp/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
