Terry Hogan wrote: > Here's the output: > > animals/ > animals/Cats/ > animals/Cats/Tabby/ > animals/Dogs/ > animals/Dogs/Beagle/ > animals/Dogs/German Shepard/ > Beagle/ > Beagle// > Beagle/// > Cats/ > Cats/Tabby/ > Cats/Tabby// > Dogs/ > Dogs/Beagle/ > Dogs/Beagle// > Dogs/German Shepard/ > Dogs/German Shepard// > German Shepard/ > German Shepard// > German Shepard/// > Tabby/ > Tabby// > Tabby///
<cfquery name="tree" datasource="#request.dsn#" dbtype="ODBC"> SELECT a.categoryname AS cat1, b.categoryname AS cat2, c.categoryname AS cat3 FROM tblCategory a LEFT JOIN tblCategory b ON a.CategoryID = b.ParentID LEFT JOIN tblCategory c ON b.CategoryID = c.ParentID WHERE a.level = 1 ORDER BY a.categoryname, b.categoryname, c.categoryname </cfquery> Jochem ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Signup for the Fusion Authority news alert and keep up with the latest news in ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4