<?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"
	>
<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>
	<pubDate>Wed, 15 Oct 2008 19:06:48 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5</generator>
		<item>
		<title>By: Eddie Awad</title>
		<link>http://awads.net/wp/2006/03/20/back-to-basics-inner-joins/#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>FARIZA, The following joins will return the level in rows. Then you can write a &lt;a href="http://asktom.oracle.com/pls/ask/search?p_string=stragg" rel="nofollow"&gt;stragg function&lt;/a&gt; to transform the level to a comma delimeted list of values. 

By the way, level is reserved, can't use it in SQL unless you quote it.

&lt;pre&gt;
 SELECT emp.name, emp.passport, edu."level"
   FROM emp, edu
  WHERE emp.passport = edu.passport;
&lt;/pre&gt;

Or using ANSI SQL:

&lt;pre&gt;
 SELECT emp.name, emp.passport, edu."level"
   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-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>eDDIE , what i mean is like the senario bellow

emp ( name, passport PK)
with 3 DATA :
('FORD','900000' ), ('CHANG','989999'),('CRISS;,'877777')
table edu('passport' ,'level','result')
with 6 DATA :
('900000' ,'DIPLOMA','3.4')
('900000' ,'DEGREE','3.0')
('900000' ,'MASTER','4.0')
('989999' ,'HIGHSCHOOL','2.0')
('989999' ,'DEGREE','3.0')
('877777' ,'HIGHSCHOOL','2.5')

RESULT SHOULD LIKE THIS

NAME    PASSPORT  LEVEL 
---------------------------------------------------
FORD     900000  DIPLOMA DEGREE  ASTER
CHANG   989999  HIGHSCHOOL    DEGREE
CRISS    877777   HIGHSCHOOL

is it posibble to do the SQL join ?
thanks so much</description>
		<content:encoded><![CDATA[<p>eDDIE , what i mean is like the senario bellow</p>
<p>emp ( name, passport PK)<br />
with 3 DATA :<br />
(&#8217;FORD&#8217;,'900000&#8242; ), (&#8217;CHANG&#8217;,'989999&#8242;),(&#8217;CRISS;,&#8217;877777&#8242;)<br />
table edu(&#8217;passport&#8217; ,&#8217;level&#8217;,'result&#8217;)<br />
with 6 DATA :<br />
(&#8217;900000&#8242; ,&#8217;DIPLOMA&#8217;,'3.4&#8242;)<br />
(&#8217;900000&#8242; ,&#8217;DEGREE&#8217;,'3.0&#8242;)<br />
(&#8217;900000&#8242; ,&#8217;MASTER&#8217;,'4.0&#8242;)<br />
(&#8217;989999&#8242; ,&#8217;HIGHSCHOOL&#8217;,'2.0&#8242;)<br />
(&#8217;989999&#8242; ,&#8217;DEGREE&#8217;,'3.0&#8242;)<br />
(&#8217;877777&#8242; ,&#8217;HIGHSCHOOL&#8217;,'2.5&#8242;)</p>
<p>RESULT SHOULD LIKE THIS</p>
<p>NAME    PASSPORT  LEVEL<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
FORD     900000  DIPLOMA DEGREE  ASTER<br />
CHANG   989999  HIGHSCHOOL    DEGREE<br />
CRISS    877777   HIGHSCHOOL</p>
<p>is it posibble to do the SQL join ?<br />
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-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>FARIZA, you join the two tables on the column a1. Then select columns from both tables.</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-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>Thanks Eddie for SQL MINUS Solution.

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

thanks</description>
		<content:encoded><![CDATA[<p>Thanks Eddie for SQL MINUS Solution.</p>
<p>Another Question<br />
I have 2 table :<br />
T1 have a1,b1,c1 fields<br />
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?<br />
exp result :<br />
a1,b1,c1,x2,x3,x4<br />
a1,b1,c1,x3,x4<br />
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-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>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.</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-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>Eddie, how to list all infromation in table A that ni in table B, tq</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-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'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 "missing" 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<br />
WHERE EMP.DEPTNO = DEPT.DEPTNO. Foreign key joins are examples of equijoins.</p>
<p>EQUI joins can be INNER or OUTER joins:<br />
SELECT EMP.NAME, &#8230; , DEPT.DNAME<br />
FROM EMP, DEPT<br />
WHERE EMP.DEPTNO = DEPT.DEPTNO &#8212; inner join, equi join</p>
<p>or<br />
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<br />
FROM EMP<br />
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-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-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-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,<br />
          dept.dept_name<br />
     FROM emp INNER JOIN dept<br />
          ON emp.dept_id = dept.dept_id<br />
          INNER JOIN addresses<br />
          ON emp.address_id = addresses.address_id</p>
]]></content:encoded>
	</item>
</channel>
</rss>
