<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	
	xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: Back to basics: self joins</title>
	<atom:link href="http://awads.net/wp/2006/07/11/back-to-basics-self-joins/feed/" rel="self" type="application/rss+xml" />
	<link>http://awads.net/wp/2006/07/11/back-to-basics-self-joins/</link>
	<description>News, views, tips and tricks on Oracle and other fun stuff</description>
	<lastBuildDate>Tue, 24 Jan 2012 20:49:08 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Sukaina</title>
		<link>http://awads.net/wp/2006/07/11/back-to-basics-self-joins/comment-page-1/#comment-50833</link>
		<dc:creator>Sukaina</dc:creator>
		<pubDate>Thu, 31 May 2007 07:36:48 +0000</pubDate>
		<guid isPermaLink="false">http://awads.net/wp/2006/07/11/back-to-basics-self-joins/#comment-50833</guid>
		<description>&lt;p&gt;As stated by Eddie:
WHERE d1.department_id IN (10, 20, 30, 40)
   AND d2.department_id IN (10, 20, 30, 40);
What if the department_ids are around 100 in number, would it not be a roblem to enter all department_ids in the query. Using Oracle I can solve it, however using ANSI do we have to use a subquery there as in Oracle or is there a seperate way. Please let me know.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>As stated by Eddie:
WHERE d1.department_id IN (10, 20, 30, 40)
   AND d2.department_id IN (10, 20, 30, 40);
What if the department_ids are around 100 in number, would it not be a roblem to enter all department_ids in the query. Using Oracle I can solve it, however using ANSI do we have to use a subquery there as in Oracle or is there a seperate way. Please let me know.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Eddie Awad</title>
		<link>http://awads.net/wp/2006/07/11/back-to-basics-self-joins/comment-page-1/#comment-27104</link>
		<dc:creator>Eddie Awad</dc:creator>
		<pubDate>Wed, 12 Jul 2006 16:46:39 +0000</pubDate>
		<guid isPermaLink="false">http://awads.net/wp/2006/07/11/back-to-basics-self-joins/#comment-27104</guid>
		<description>&lt;p&gt;Yas, you&#039;re right, the corrected statement that describes&lt;/p&gt;

&lt;p&gt;WHERE e.manager_id = m.employee_id (+)&lt;/p&gt;

&lt;p&gt;is:&lt;/p&gt;

&lt;p&gt;The (+) operator following m.employee_id means that you want to display a row from the e table, even though there exists no corresponding row in the m table.&lt;/p&gt;

&lt;p&gt;Thanks for catching it.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Yas, you&#8217;re right, the corrected statement that describes</p>

<p>WHERE e.manager_id = m.employee_id (+)</p>

<p>is:</p>

<p>The (+) operator following m.employee_id means that you want to display a row from the e table, even though there exists no corresponding row in the m table.</p>

<p>Thanks for catching it.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Nelson</title>
		<link>http://awads.net/wp/2006/07/11/back-to-basics-self-joins/comment-page-1/#comment-27085</link>
		<dc:creator>Nelson</dc:creator>
		<pubDate>Wed, 12 Jul 2006 14:27:38 +0000</pubDate>
		<guid isPermaLink="false">http://awads.net/wp/2006/07/11/back-to-basics-self-joins/#comment-27085</guid>
		<description>&lt;p&gt;Just a bit off topic.
I clicked on the Spain&#039;s flag on top of the screen and the text it showed make no sense at all!
The damn thing even translate the code so it is a bit futile to run that translation.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Just a bit off topic.
I clicked on the Spain&#8217;s flag on top of the screen and the text it showed make no sense at all!
The damn thing even translate the code so it is a bit futile to run that translation.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: yas</title>
		<link>http://awads.net/wp/2006/07/11/back-to-basics-self-joins/comment-page-1/#comment-27056</link>
		<dc:creator>yas</dc:creator>
		<pubDate>Wed, 12 Jul 2006 09:12:49 +0000</pubDate>
		<guid isPermaLink="false">http://awads.net/wp/2006/07/11/back-to-basics-self-joins/#comment-27056</guid>
		<description>&lt;p&gt;&lt;i&gt;The (+) operator following m.employee_id means that you want to display a row from the m table, even though there exists no corresponding row in the e table&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;Eddie, i think it must be the other way around. This code gets all rows from e, not m. This (+) is usually confusing to many people, it makes the sql get all the rows from the table on the other side.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p><i>The (+) operator following m.employee_id means that you want to display a row from the m table, even though there exists no corresponding row in the e table</i></p>

<p>Eddie, i think it must be the other way around. This code gets all rows from e, not m. This (+) is usually confusing to many people, it makes the sql get all the rows from the table on the other side.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Eddie Awad</title>
		<link>http://awads.net/wp/2006/07/11/back-to-basics-self-joins/comment-page-1/#comment-26973</link>
		<dc:creator>Eddie Awad</dc:creator>
		<pubDate>Wed, 12 Jul 2006 01:45:10 +0000</pubDate>
		<guid isPermaLink="false">http://awads.net/wp/2006/07/11/back-to-basics-self-joins/#comment-26973</guid>
		<description>&lt;p&gt;Hi Rob,&lt;/p&gt;

&lt;p&gt;The difference between using JOIN/ON and just using WHERE is that the first uses the ANSI/ISO SQL92 standard syntax, and the second uses the good old Oracle syntax.&lt;/p&gt;

&lt;p&gt;I refer you to &lt;a href=&quot;http://awads.net/wp/2006/03/16/back-to-basics-cross-joins/&quot; rel=&quot;nofollow&quot;&gt;this post&lt;/a&gt; for some discussion about the difference between the two and the advantages/disadvantages of using the ANSI SQL syntax (make sure you read &lt;a href=&quot;http://awads.net/wp/2006/03/16/back-to-basics-cross-joins/#comments&quot; rel=&quot;nofollow&quot;&gt;the comments&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;By the way,&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;FROM employees e LEFT OUTER JOIN employees m
   ON e.manager_id = m.employee_id
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;translates to&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;    FROM employees e, employees m
 WHERE e.manager_id = m.employee_id (+)
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The (+) operator following m.employee_id means that you want to display a row from the m table, even though there exists no corresponding row in the e table, and that&#039;s what the LEFT OUTER JOIN above means.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Hi Rob,</p>

<p>The difference between using JOIN/ON and just using WHERE is that the first uses the ANSI/ISO SQL92 standard syntax, and the second uses the good old Oracle syntax.</p>

<p>I refer you to <a href="http://awads.net/wp/2006/03/16/back-to-basics-cross-joins/" rel="nofollow">this post</a> for some discussion about the difference between the two and the advantages/disadvantages of using the ANSI SQL syntax (make sure you read <a href="http://awads.net/wp/2006/03/16/back-to-basics-cross-joins/#comments" rel="nofollow">the comments</a>).</p>

<p>By the way,</p>

<pre><code>FROM employees e LEFT OUTER JOIN employees m
   ON e.manager_id = m.employee_id
</code></pre>

<p>translates to</p>

<pre><code>    FROM employees e, employees m
 WHERE e.manager_id = m.employee_id (+)
</code></pre>

<p>The (+) operator following m.employee_id means that you want to display a row from the m table, even though there exists no corresponding row in the e table, and that&#8217;s what the LEFT OUTER JOIN above means.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Robert Vollman</title>
		<link>http://awads.net/wp/2006/07/11/back-to-basics-self-joins/comment-page-1/#comment-26884</link>
		<dc:creator>Robert Vollman</dc:creator>
		<pubDate>Tue, 11 Jul 2006 22:25:25 +0000</pubDate>
		<guid isPermaLink="false">http://awads.net/wp/2006/07/11/back-to-basics-self-joins/#comment-26884</guid>
		<description>&lt;p&gt;What is the difference between using JOIN/ON and just using WHERE?&lt;/p&gt;

&lt;p&gt;For example, take your second query, and instead make it
FROM employee e, employee m WHERE e.manager_id(+) = m.employee_id&lt;/p&gt;

&lt;p&gt;I&#039;ve never used the JOIN/ON syntax.  Does it have an advantage?&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>What is the difference between using JOIN/ON and just using WHERE?</p>

<p>For example, take your second query, and instead make it
FROM employee e, employee m WHERE e.manager_id(+) = m.employee_id</p>

<p>I&#8217;ve never used the JOIN/ON syntax.  Does it have an advantage?</p>]]></content:encoded>
	</item>
</channel>
</rss>

