<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.2.3" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>
<channel>
	<title>Comments on: Creating Recursive SQL Calls for Tables with Parent-Child Relationships</title>
	<link>http://www.webinade.com/web-development/creating-recursive-sql-calls-for-tables-with-parent-child-relationships</link>
	<description>Freshly Squeezed</description>
	<pubDate>Wed, 20 Aug 2008 13:58:53 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.2.3</generator>

	<item>
		<title>By: Mark</title>
		<link>http://www.webinade.com/web-development/creating-recursive-sql-calls-for-tables-with-parent-child-relationships#comment-1502</link>
		<dc:creator>Mark</dc:creator>
		<pubDate>Thu, 07 Aug 2008 00:31:26 +0000</pubDate>
		<guid>http://www.webinade.com/web-development/creating-recursive-sql-calls-for-tables-with-parent-child-relationships#comment-1502</guid>
		<description>Thank you for sharing this. I had a similar issue looking at categories of various levels (category-subcate-subsubcate .. etc), and your script helped tremendously. One thing I'd like to point out though, from following your code, is that you missed a space in "ALLSELECT" (making it "ALL SELECT"). Me with my entry level sql knowledge thought it was some secret keyword I've never came across. ;)</description>
		<content:encoded><![CDATA[<p>Thank you for sharing this. I had a similar issue looking at categories of various levels (category-subcate-subsubcate .. etc), and your script helped tremendously. One thing I&#8217;d like to point out though, from following your code, is that you missed a space in &#8220;ALLSELECT&#8221; (making it &#8220;ALL SELECT&#8221;). Me with my entry level sql knowledge thought it was some secret keyword I&#8217;ve never came across. <img src='http://www.webinade.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Uma</title>
		<link>http://www.webinade.com/web-development/creating-recursive-sql-calls-for-tables-with-parent-child-relationships#comment-926</link>
		<dc:creator>Uma</dc:creator>
		<pubDate>Thu, 22 May 2008 16:52:17 +0000</pubDate>
		<guid>http://www.webinade.com/web-development/creating-recursive-sql-calls-for-tables-with-parent-child-relationships#comment-926</guid>
		<description>very interesting article. wish i had known this earlier, would have saved me a lot of trouble.  but knowing it now with such a clear explanation is very much worth appreciating the author.</description>
		<content:encoded><![CDATA[<p>very interesting article. wish i had known this earlier, would have saved me a lot of trouble.  but knowing it now with such a clear explanation is very much worth appreciating the author.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: GJL</title>
		<link>http://www.webinade.com/web-development/creating-recursive-sql-calls-for-tables-with-parent-child-relationships#comment-923</link>
		<dc:creator>GJL</dc:creator>
		<pubDate>Wed, 21 May 2008 19:45:51 +0000</pubDate>
		<guid>http://www.webinade.com/web-development/creating-recursive-sql-calls-for-tables-with-parent-child-relationships#comment-923</guid>
		<description>Thanks!  I never knew that this method existed. It has saved me a lot of time.</description>
		<content:encoded><![CDATA[<p>Thanks!  I never knew that this method existed. It has saved me a lot of time.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Glen</title>
		<link>http://www.webinade.com/web-development/creating-recursive-sql-calls-for-tables-with-parent-child-relationships#comment-805</link>
		<dc:creator>Glen</dc:creator>
		<pubDate>Mon, 07 Apr 2008 18:06:58 +0000</pubDate>
		<guid>http://www.webinade.com/web-development/creating-recursive-sql-calls-for-tables-with-parent-child-relationships#comment-805</guid>
		<description>Thank you for this!  I used your example to replace a cursor method I was using and it cut the query response time to about half.

Very nice article!

   - Glen</description>
		<content:encoded><![CDATA[<p>Thank you for this!  I used your example to replace a cursor method I was using and it cut the query response time to about half.</p>
<p>Very nice article!</p>
<p>   - Glen</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Time Employee Equivalent</title>
		<link>http://www.webinade.com/web-development/creating-recursive-sql-calls-for-tables-with-parent-child-relationships#comment-278</link>
		<dc:creator>Time Employee Equivalent</dc:creator>
		<pubDate>Sat, 09 Feb 2008 22:11:37 +0000</pubDate>
		<guid>http://www.webinade.com/web-development/creating-recursive-sql-calls-for-tables-with-parent-child-relationships#comment-278</guid>
		<description>&lt;strong&gt;Do you want to know if your employees are working or are wasting time?...&lt;/strong&gt;

In our days productivity has become the God of industry, so all employers expect employees to work faster, work smarter and work more....</description>
		<content:encoded><![CDATA[<p><strong>Do you want to know if your employees are working or are wasting time?&#8230;</strong></p>
<p>In our days productivity has become the God of industry, so all employers expect employees to work faster, work smarter and work more&#8230;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sean</title>
		<link>http://www.webinade.com/web-development/creating-recursive-sql-calls-for-tables-with-parent-child-relationships#comment-75</link>
		<dc:creator>Sean</dc:creator>
		<pubDate>Sat, 01 Dec 2007 04:09:48 +0000</pubDate>
		<guid>http://www.webinade.com/web-development/creating-recursive-sql-calls-for-tables-with-parent-child-relationships#comment-75</guid>
		<description>Would a 'connect by' statement work here?

select 		employee, subordinate, level
from 		orgChart
start with 	employee = 'Frank'
connect by 	subordinate = prior employee

If I'm not mistaken, this would produce a list of employees who report to Frank. 'level' in this case would produce an incremented number based on the 'level' below Frank.

I'm a little confused by the implied schema of the orgChart. I think it would be better if each employee record held a reference to the supervisor, but whatever.</description>
		<content:encoded><![CDATA[<p>Would a &#8216;connect by&#8217; statement work here?</p>
<p>select 		employee, subordinate, level<br />
from 		orgChart<br />
start with 	employee = &#8216;Frank&#8217;<br />
connect by 	subordinate = prior employee</p>
<p>If I&#8217;m not mistaken, this would produce a list of employees who report to Frank. &#8216;level&#8217; in this case would produce an incremented number based on the &#8216;level&#8217; below Frank.</p>
<p>I&#8217;m a little confused by the implied schema of the orgChart. I think it would be better if each employee record held a reference to the supervisor, but whatever.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Juan</title>
		<link>http://www.webinade.com/web-development/creating-recursive-sql-calls-for-tables-with-parent-child-relationships#comment-17</link>
		<dc:creator>Juan</dc:creator>
		<pubDate>Wed, 10 Oct 2007 13:23:40 +0000</pubDate>
		<guid>http://www.webinade.com/web-development/creating-recursive-sql-calls-for-tables-with-parent-child-relationships#comment-17</guid>
		<description>I understand how MPTT can be used for easy retrieval from a tree.  However, am I missing something, or will every change (insert/delete/move) to a tree mean that the right/left values of every node in the tree may need to be rebuilt?  It seems to me that any time the tree changes, you have to do a recursive traversal to rebuild the MPTT indices, and only after that could you take advantage of MPTT's easy retrieval.  Of course in some situations it's a worthwhile tradeoff - I just want to make sure I'm characterizing this correctly.  Thanks, -Juan</description>
		<content:encoded><![CDATA[<p>I understand how MPTT can be used for easy retrieval from a tree.  However, am I missing something, or will every change (insert/delete/move) to a tree mean that the right/left values of every node in the tree may need to be rebuilt?  It seems to me that any time the tree changes, you have to do a recursive traversal to rebuild the MPTT indices, and only after that could you take advantage of MPTT&#8217;s easy retrieval.  Of course in some situations it&#8217;s a worthwhile tradeoff - I just want to make sure I&#8217;m characterizing this correctly.  Thanks, -Juan</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: links for 2007-10-01 &#171; D e j a m e S e r</title>
		<link>http://www.webinade.com/web-development/creating-recursive-sql-calls-for-tables-with-parent-child-relationships#comment-10</link>
		<dc:creator>links for 2007-10-01 &#171; D e j a m e S e r</dc:creator>
		<pubDate>Mon, 01 Oct 2007 15:18:50 +0000</pubDate>
		<guid>http://www.webinade.com/web-development/creating-recursive-sql-calls-for-tables-with-parent-child-relationships#comment-10</guid>
		<description>[...] Creating Recursive SQL Calls for Tables with Parent-Child Relationships at Webinade (tags: sql) [...]</description>
		<content:encoded><![CDATA[<p>[&#8230;] Creating Recursive SQL Calls for Tables with Parent-Child Relationships at Webinade (tags: sql) [&#8230;]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David</title>
		<link>http://www.webinade.com/web-development/creating-recursive-sql-calls-for-tables-with-parent-child-relationships#comment-9</link>
		<dc:creator>David</dc:creator>
		<pubDate>Sun, 30 Sep 2007 23:17:40 +0000</pubDate>
		<guid>http://www.webinade.com/web-development/creating-recursive-sql-calls-for-tables-with-parent-child-relationships#comment-9</guid>
		<description>I guess this works, but a much cleaner, clearer and efficient way to achieve this is to use an MPTT (modified pre-order tree traversal) table.  It employs the use of a 'left' and 'right' value for each node in the tree, and with one sql query (no temporary views/tables) you can get the complete (and ordered) list of all children, or if you know the child and want all parents, you can get a breadcrumb trail back up the tree as well with one query.  Work smart, not hard :)</description>
		<content:encoded><![CDATA[<p>I guess this works, but a much cleaner, clearer and efficient way to achieve this is to use an MPTT (modified pre-order tree traversal) table.  It employs the use of a &#8216;left&#8217; and &#8216;right&#8217; value for each node in the tree, and with one sql query (no temporary views/tables) you can get the complete (and ordered) list of all children, or if you know the child and want all parents, you can get a breadcrumb trail back up the tree as well with one query.  Work smart, not hard <img src='http://www.webinade.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Roman Mackovcak</title>
		<link>http://www.webinade.com/web-development/creating-recursive-sql-calls-for-tables-with-parent-child-relationships#comment-8</link>
		<dc:creator>Roman Mackovcak</dc:creator>
		<pubDate>Sun, 30 Sep 2007 22:29:37 +0000</pubDate>
		<guid>http://www.webinade.com/web-development/creating-recursive-sql-calls-for-tables-with-parent-child-relationships#comment-8</guid>
		<description>I would prefer using nested sets. There should be libraries for your language.</description>
		<content:encoded><![CDATA[<p>I would prefer using nested sets. There should be libraries for your language.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
