Account Options

  1. Sign in
Google Groups Home
« Groups Home
Some understanding about joins
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  6 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
tawright915  
View profile  
 More options Sep 21 2006, 4:52 pm
From: "tawright915" <tawright...@gmail.com>
Date: Thu, 21 Sep 2006 13:52:17 -0700
Local: Thurs, Sep 21 2006 4:52 pm
Subject: Some understanding about joins
Can someone please help me in understanding inner and outer joins?  I
seem to have a block when it comes to understanding this concept.

And please if you have nothing helpful to contribute then please do not
reply.

Thanks
Tom


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Charles Hooper  
View profile  
 More options Sep 21 2006, 9:57 pm
From: "Charles Hooper" <hooperc2...@yahoo.com>
Date: Thu, 21 Sep 2006 18:57:54 -0700
Local: Thurs, Sep 21 2006 9:57 pm
Subject: Re: Some understanding about joins

tawright915 wrote:
> Can someone please help me in understanding inner and outer joins?  I
> seem to have a block when it comes to understanding this concept.

> And please if you have nothing helpful to contribute then please do not
> reply.

> Thanks
> Tom

Short answer:
* Inner join - the value must be in BOTH tables
* Outer join - the value must be in at least ONE table

Assume that the following table and columns in those tables, and data
in those columns exist:
TABLE_1.ANIMAL
COW
PIG
ZEBRA
SHARK
ROOSTER
LION

TABLE_2.ANIMAL
COW
PIG
DOG

TABLE_3.ANIMAL
ZEBRA
LION
TIGER

Inner join TABLE_2 and TABLE_3
SELECT
  T2.ANIMAL,
  T3.ANIMAL
FROM
  TABLE_2 T2,
  TABLE_3 T3
WHERE
  T2.ANIMAL=T3.ANIMAL;

(no results)
-------------------

(Left) Outer join TABLE_2 and TABLE_3, include all rows from TABLE_2
SELECT
  T2.ANIMAL,
  T3.ANIMAL
FROM
  TABLE_2 T2,
  TABLE_3 T3
WHERE
  T2.ANIMAL=T3.ANIMAL(+);

T2.ANIMAL   T3.ANIMAL
COW            (null)
PIG               (null)
DOG             (null)
-------------------

Inner join TABLE_1 and TABLE_2
SELECT
  T1.ANIMAL,
  T2.ANIMAL
FROM
  TABLE_1 T1,
  TABLE_2 T2
WHERE
  T1.ANIMAL=T2.ANIMAL;

TABLE_1.ANIMAL    TABLE_2.ANIMAL
COW                       COW
PIG                          PIG
-------------------

(Right) Outer join TABLE_1 and TABLE_2, include all rows from TABLE_2
SELECT
  T1.ANIMAL,
  T2.ANIMAL
FROM
  TABLE_1 T1,
  TABLE_2 T2
WHERE
  T1.ANIMAL(+)=T2.ANIMAL;

TABLE_1.ANIMAL    TABLE_2.ANIMAL
COW                       COW
PIG                          PIG
(null)                         DOG
-------------------

(One Method, Full) Outer join TABLE_1 and TABLE_2, include all rows
SELECT
  T1.ANIMAL,
  T2.ANIMAL
FROM
  TABLE_1 T1,
  TABLE_2 T2
WHERE
  T1.ANIMAL(+)=T2.ANIMAL
UNION
SELECT
  T1.ANIMAL,
  T2.ANIMAL
FROM
  TABLE_1 T1,
  TABLE_2 T2
WHERE
  T1.ANIMAL=T2.ANIMAL(+);

TABLE_1.ANIMAL    TABLE_2.ANIMAL
COW                       COW
PIG                          PIG
(null)                         DOG
ZEBRA                     (null)
SHARK                    (null)
ROOSTER                (null)
LION                        (null)

Charles Hooper
PC Support Specialist
K&M Machine-Fabricating, Inc.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
tawright915  
View profile  
 More options Sep 22 2006, 9:38 am
From: "tawright915" <tawright...@gmail.com>
Date: Fri, 22 Sep 2006 06:38:01 -0700
Local: Fri, Sep 22 2006 9:38 am
Subject: Re: Some understanding about joins
Thank you so much. The light went on.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
john.mcafee@newscale.com  
View profile  
 More options Sep 27 2006, 12:31 am
From: "john.mca...@newscale.com" <juan.mca...@gmail.com>
Date: Tue, 26 Sep 2006 21:31:35 -0700
Local: Wed, Sep 27 2006 12:31 am
Subject: Re: Some understanding about joins
There's a good discussion at http://en.wikipedia.org/wiki/Join_(SQL)

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
ExpertDba  
View profile  
 More options Sep 27 2006, 10:58 pm
From: "ExpertDba" <best.grey...@gmail.com>
Date: Wed, 27 Sep 2006 19:58:35 -0700
Local: Wed, Sep 27 2006 10:58 pm
Subject: Re: Some understanding about joins
Charles Hooper,

 Beautifully put answer!

regards,
Channesh


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
siva  
View profile  
 More options Sep 30 2006, 12:18 am
From: "siva" <phaneendra.mo...@gmail.com>
Date: Sat, 30 Sep 2006 04:18:08 -0000
Local: Sat, Sep 30 2006 12:18 am
Subject: Re: Some understanding about joins
Thanks Charles Hooper,

its really a nice reply it helped me to get out of the confusion
between the both

thanking you once again

regards

siva.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »