chris.alvarado wrote: > Still trying to decide how I like to perform some type of recursive > query wth the following Table structure; > > ID NAME PARENT_ID > > If the current record IS the parent then the Parent ID is 0 > > Otherwise the child has the ID of the parent as it's Parent ID. > > > Anyone have any good references on recursive queries to handle this? A > way to spider down through the parents and children basically. > > Ive done this before using Stored Procs and temp tables, but there has > to be an easier way. > > Any suggestions?
If Oracle, look up CONNECT BY PRIOR ... START WITH ... in the manual. Never used it, but I think it does something like this. In general you might want to take a look at the nested set model, for certain types of applications it is very nice (high read/write ratio). And don't forget to ask on a mailinglist for your DBMS, there are usually more proficient people hanging out there. Jochem ______________________________________________________________________ Get the mailserver that powers this list at http://www.coolfusion.com FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists