<?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: inner joins</title>
	<atom:link href="http://awads.net/wp/2006/03/20/back-to-basics-inner-joins/feed/" rel="self" type="application/rss+xml" />
	<link>http://awads.net/wp/2006/03/20/back-to-basics-inner-joins/</link>
	<description>News, views, tips and tricks on Oracle and other fun stuff</description>
	<lastBuildDate>Thu, 18 Mar 2010 16:44:12 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Eddie Awad</title>
		<link>http://awads.net/wp/2006/03/20/back-to-basics-inner-joins/comment-page-1/#comment-52098</link>
		<dc:creator>Eddie Awad</dc:creator>
		<pubDate>Fri, 25 Apr 2008 22:15:52 +0000</pubDate>
		<guid isPermaLink="false">http://awads.net/wp/?p=238#comment-52098</guid>
		<description>&lt;p&gt;FARIZA, The following joins will return the level in rows. Then you can write a &lt;a href=&quot;http://asktom.oracle.com/pls/ask/search?p_string=stragg&quot; rel=&quot;nofollow&quot;&gt;stragg function&lt;/a&gt; to transform the level to a comma delimeted list of values.&lt;/p&gt;

&lt;p&gt;By the way, level is reserved, can&#039;t use it in SQL unless you quote it.&lt;/p&gt;

&lt;pre&gt;
 SELECT emp.name, emp.passport, edu.&quot;level&quot;
   FROM emp, edu
  WHERE emp.passport = edu.passport;
&lt;/pre&gt;

&lt;p&gt;Or using ANSI SQL:&lt;/p&gt;

&lt;pre&gt;
 SELECT emp.name, emp.passport, edu.&quot;level&quot;
   FROM emp inner join edu on emp.passport = edu.passport;
&lt;/pre&gt;
</description>
		<content:encoded><![CDATA[<p>FARIZA, The following joins will return the level in rows. Then you can write a <a href="http://asktom.oracle.com/pls/ask/search?p_string=stragg" rel="nofollow">stragg function</a> to transform the level to a comma delimeted list of values.</p>

<p>By the way, level is reserved, can&#8217;t use it in SQL unless you quote it.</p>

<pre>
 SELECT emp.name, emp.passport, edu."level"
   FROM emp, edu
  WHERE emp.passport = edu.passport;
</pre>

<p>Or using ANSI SQL:</p>

<pre>
 SELECT emp.name, emp.passport, edu."level"
   FROM emp inner join edu on emp.passport = edu.passport;
</pre>]]></content:encoded>
	</item>
	<item>
		<title>By: FARIZA</title>
		<link>http://awads.net/wp/2006/03/20/back-to-basics-inner-joins/comment-page-1/#comment-52095</link>
		<dc:creator>FARIZA</dc:creator>
		<pubDate>Thu, 24 Apr 2008 05:55:07 +0000</pubDate>
		<guid isPermaLink="false">http://awads.net/wp/?p=238#comment-52095</guid>
		<description>&lt;p&gt;eDDIE , what i mean is like the senario bellow&lt;/p&gt;

&lt;p&gt;emp ( name, passport PK)
with 3 DATA :
(&#039;FORD&#039;,&#039;900000&#039; ), (&#039;CHANG&#039;,&#039;989999&#039;),(&#039;CRISS;,&#039;877777&#039;)
table edu(&#039;passport&#039; ,&#039;level&#039;,&#039;result&#039;)
with 6 DATA :
(&#039;900000&#039; ,&#039;DIPLOMA&#039;,&#039;3.4&#039;)
(&#039;900000&#039; ,&#039;DEGREE&#039;,&#039;3.0&#039;)
(&#039;900000&#039; ,&#039;MASTER&#039;,&#039;4.0&#039;)
(&#039;989999&#039; ,&#039;HIGHSCHOOL&#039;,&#039;2.0&#039;)
(&#039;989999&#039; ,&#039;DEGREE&#039;,&#039;3.0&#039;)
(&#039;877777&#039; ,&#039;HIGHSCHOOL&#039;,&#039;2.5&#039;)&lt;/p&gt;

&lt;p&gt;RESULT SHOULD LIKE THIS&lt;/p&gt;

&lt;h2&gt;NAME    PASSPORT  LEVEL&lt;/h2&gt;

&lt;p&gt;FORD     900000  DIPLOMA DEGREE  ASTER
CHANG   989999  HIGHSCHOOL    DEGREE
CRISS    877777   HIGHSCHOOL&lt;/p&gt;

&lt;p&gt;is it posibble to do the SQL join ?
thanks so much&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>eDDIE , what i mean is like the senario bellow</p>

<p>emp ( name, passport PK)
with 3 DATA :
(&#8216;FORD&#8217;,'900000&#8242; ), (&#8216;CHANG&#8217;,'989999&#8242;),(&#8216;CRISS;,&#8217;877777&#8242;)
table edu(&#8216;passport&#8217; ,&#8217;level&#8217;,'result&#8217;)
with 6 DATA :
(&#8216;900000&#8242; ,&#8217;DIPLOMA&#8217;,'3.4&#8242;)
(&#8216;900000&#8242; ,&#8217;DEGREE&#8217;,'3.0&#8242;)
(&#8216;900000&#8242; ,&#8217;MASTER&#8217;,'4.0&#8242;)
(&#8216;989999&#8242; ,&#8217;HIGHSCHOOL&#8217;,'2.0&#8242;)
(&#8216;989999&#8242; ,&#8217;DEGREE&#8217;,'3.0&#8242;)
(&#8216;877777&#8242; ,&#8217;HIGHSCHOOL&#8217;,'2.5&#8242;)</p>

<p>RESULT SHOULD LIKE THIS</p>

<h2>NAME    PASSPORT  LEVEL</h2>

<p>FORD     900000  DIPLOMA DEGREE  ASTER
CHANG   989999  HIGHSCHOOL    DEGREE
CRISS    877777   HIGHSCHOOL</p>

<p>is it posibble to do the SQL join ?
thanks so much</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Eddie Awad</title>
		<link>http://awads.net/wp/2006/03/20/back-to-basics-inner-joins/comment-page-1/#comment-52094</link>
		<dc:creator>Eddie Awad</dc:creator>
		<pubDate>Thu, 24 Apr 2008 04:26:46 +0000</pubDate>
		<guid isPermaLink="false">http://awads.net/wp/?p=238#comment-52094</guid>
		<description>&lt;p&gt;FARIZA, you join the two tables on the column a1. Then select columns from both tables.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>FARIZA, you join the two tables on the column a1. Then select columns from both tables.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: FARIZA</title>
		<link>http://awads.net/wp/2006/03/20/back-to-basics-inner-joins/comment-page-1/#comment-52092</link>
		<dc:creator>FARIZA</dc:creator>
		<pubDate>Wed, 23 Apr 2008 23:12:15 +0000</pubDate>
		<guid isPermaLink="false">http://awads.net/wp/?p=238#comment-52092</guid>
		<description>&lt;p&gt;Thanks Eddie for SQL MINUS Solution.&lt;/p&gt;

&lt;p&gt;Another Question
I have 2 table :
T1 have a1,b1,c1 fields
T2 have x2,x3,x4, a1 as FK from T1. These two table has a one to many relationship. How I want to display the two table as one record?
exp result :
a1,b1,c1,x2,x3,x4
a1,b1,c1,x3,x4
a1,b1,x2,x3,x4&lt;/p&gt;

&lt;p&gt;thanks&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Thanks Eddie for SQL MINUS Solution.</p>

<p>Another Question
I have 2 table :
T1 have a1,b1,c1 fields
T2 have x2,x3,x4, a1 as FK from T1. These two table has a one to many relationship. How I want to display the two table as one record?
exp result :
a1,b1,c1,x2,x3,x4
a1,b1,c1,x3,x4
a1,b1,x2,x3,x4</p>

<p>thanks</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Eddie Awad</title>
		<link>http://awads.net/wp/2006/03/20/back-to-basics-inner-joins/comment-page-1/#comment-51994</link>
		<dc:creator>Eddie Awad</dc:creator>
		<pubDate>Thu, 21 Feb 2008 16:54:19 +0000</pubDate>
		<guid isPermaLink="false">http://awads.net/wp/?p=238#comment-51994</guid>
		<description>&lt;p&gt;FARIZA, your question is too general. You may want to take a look at the SQL MINUS operator as well as (NOT) EXISTS and (NOT) IN.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>FARIZA, your question is too general. You may want to take a look at the SQL MINUS operator as well as (NOT) EXISTS and (NOT) IN.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: FARIZA</title>
		<link>http://awads.net/wp/2006/03/20/back-to-basics-inner-joins/comment-page-1/#comment-51991</link>
		<dc:creator>FARIZA</dc:creator>
		<pubDate>Thu, 21 Feb 2008 06:47:13 +0000</pubDate>
		<guid isPermaLink="false">http://awads.net/wp/?p=238#comment-51991</guid>
		<description>&lt;p&gt;Eddie, how to list all infromation in table A that ni in table B, tq&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Eddie, how to list all infromation in table A that ni in table B, tq</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Nigel</title>
		<link>http://awads.net/wp/2006/03/20/back-to-basics-inner-joins/comment-page-1/#comment-51680</link>
		<dc:creator>Nigel</dc:creator>
		<pubDate>Sun, 14 Oct 2007 09:46:29 +0000</pubDate>
		<guid isPermaLink="false">http://awads.net/wp/?p=238#comment-51680</guid>
		<description>&lt;p&gt;sreenivasulu&lt;/p&gt;

&lt;p&gt;an INNER join is one that isn&#039;t an OUTER join. Or to be more specific: for a row to occur in the result relation, its component pieces must be present in BOTH of the source relations. An OUTER join, in contrast, can supply null values for &quot;missing&quot; rows (in either or both of the source relations, depending on whether this is a LEFT, RIGHT or FULL outer join).&lt;/p&gt;

&lt;p&gt;an EQUI join is a special case join in which the predicates are based on equality conditions eg
WHERE EMP.DEPTNO = DEPT.DEPTNO. Foreign key joins are examples of equijoins.&lt;/p&gt;

&lt;p&gt;EQUI joins can be INNER or OUTER joins:
SELECT EMP.NAME, ... , DEPT.DNAME
FROM EMP, DEPT
WHERE EMP.DEPTNO = DEPT.DEPTNO -- inner join, equi join&lt;/p&gt;

&lt;p&gt;or 
WHERE EMP.DEPTNO = DEPT.DEPTNO (+) -- outer join, equi join&lt;/p&gt;

&lt;p&gt;In spite of being an old Oracle hacker, I actually prefer to use ANSI syntax as it is (I think) much more readable/maintainable, eg:&lt;/p&gt;

&lt;p&gt;SELECT EMP.NAME, ... , DEPT.DNAME
FROM EMP
LEFT JOIN DEPT ON EMP.DEPTNO = DEPT.DEPTNO -- outer join, equi join&lt;/p&gt;

&lt;p&gt;HTH&lt;/p&gt;

&lt;p&gt;Nigel&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>sreenivasulu</p>

<p>an INNER join is one that isn&#8217;t an OUTER join. Or to be more specific: for a row to occur in the result relation, its component pieces must be present in BOTH of the source relations. An OUTER join, in contrast, can supply null values for &#8220;missing&#8221; rows (in either or both of the source relations, depending on whether this is a LEFT, RIGHT or FULL outer join).</p>

<p>an EQUI join is a special case join in which the predicates are based on equality conditions eg
WHERE EMP.DEPTNO = DEPT.DEPTNO. Foreign key joins are examples of equijoins.</p>

<p>EQUI joins can be INNER or OUTER joins:
SELECT EMP.NAME, &#8230; , DEPT.DNAME
FROM EMP, DEPT
WHERE EMP.DEPTNO = DEPT.DEPTNO &#8212; inner join, equi join</p>

<p>or 
WHERE EMP.DEPTNO = DEPT.DEPTNO (+) &#8212; outer join, equi join</p>

<p>In spite of being an old Oracle hacker, I actually prefer to use ANSI syntax as it is (I think) much more readable/maintainable, eg:</p>

<p>SELECT EMP.NAME, &#8230; , DEPT.DNAME
FROM EMP
LEFT JOIN DEPT ON EMP.DEPTNO = DEPT.DEPTNO &#8212; outer join, equi join</p>

<p>HTH</p>

<p>Nigel</p>]]></content:encoded>
	</item>
	<item>
		<title>By: sreenivasulu</title>
		<link>http://awads.net/wp/2006/03/20/back-to-basics-inner-joins/comment-page-1/#comment-51671</link>
		<dc:creator>sreenivasulu</dc:creator>
		<pubDate>Thu, 11 Oct 2007 06:50:50 +0000</pubDate>
		<guid isPermaLink="false">http://awads.net/wp/?p=238#comment-51671</guid>
		<description>&lt;p&gt;What is the difference between Equi and Inner Joins?&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>What is the difference between Equi and Inner Joins?</p>]]></content:encoded>
	</item>
	<item>
		<title>By: sreenivasulu</title>
		<link>http://awads.net/wp/2006/03/20/back-to-basics-inner-joins/comment-page-1/#comment-51668</link>
		<dc:creator>sreenivasulu</dc:creator>
		<pubDate>Thu, 11 Oct 2007 06:46:23 +0000</pubDate>
		<guid isPermaLink="false">http://awads.net/wp/?p=238#comment-51668</guid>
		<description>&lt;p&gt;What is the difference between Inner(Simple) and Equi Joins? Could some explian me please?&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>What is the difference between Inner(Simple) and Equi Joins? Could some explian me please?</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Eddie Awad</title>
		<link>http://awads.net/wp/2006/03/20/back-to-basics-inner-joins/comment-page-1/#comment-50425</link>
		<dc:creator>Eddie Awad</dc:creator>
		<pubDate>Wed, 21 Mar 2007 16:34:49 +0000</pubDate>
		<guid isPermaLink="false">http://awads.net/wp/?p=238#comment-50425</guid>
		<description>&lt;p&gt;Fariza, for example, if you have three tables, you would write a query like this:&lt;/p&gt;

&lt;p&gt;SELECT emp.emp_name,
          dept.dept_name
     FROM emp INNER JOIN dept 
          ON emp.dept_id = dept.dept_id
          INNER JOIN addresses 
          ON emp.address_id = addresses.address_id&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Fariza, for example, if you have three tables, you would write a query like this:</p>

<p>SELECT emp.emp_name,
          dept.dept_name
     FROM emp INNER JOIN dept 
          ON emp.dept_id = dept.dept_id
          INNER JOIN addresses 
          ON emp.address_id = addresses.address_id</p>]]></content:encoded>
	</item>
</channel>
</rss>
