IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

What is the difference between Natural Join and Outer Join


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
bhaskar80

New User


Joined: 12 Apr 2007
Posts: 7
Location: bangalore

PostPosted: Tue Apr 17, 2007 2:26 pm
Reply with quote

Hi all,
can anyone give me info regarding the below query..
What is the difference between Natural Join and Outer Join
Back to top
View user's profile Send private message
ashwinreddy

Active User


Joined: 16 Sep 2004
Posts: 106
Location: Hyderabad

PostPosted: Tue Apr 17, 2007 2:40 pm
Reply with quote

Hi,

A natural join is a join where the result set contains the concatenation of rows in the right hand table whose non-null joining key matches joining keys in the left hand table.


A right (outer) join contains all the results of the natural join PLUS all the 'orphan' rows from the right hand table, i.e. those rows from the right hand table that didn't have a match in the left hand table.


A left (outer) join contains all the results of the natural join PLUS all the 'orphan' rows from the left hand table, i.e. those rows from the left hand table that didn't have a match in the right hand table.


A full (outer) join contains all the results of the natural join PLUS all the orphan rows from the right hand table PLUS all the orphan rows from the left hand table.

Cheers
Ashwin Kumar
Back to top
View user's profile Send private message
bhaskar80

New User


Joined: 12 Apr 2007
Posts: 7
Location: bangalore

PostPosted: Thu Apr 19, 2007 1:57 pm
Reply with quote

Thanks a lot Mr.Ashwin
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Join multiple records using splice DFSORT/ICETOOL 5
No new posts Join 2 files according to one key field. JCL & VSAM 3
No new posts Timestamp difference and its average ... DB2 11
No new posts Difference when accessing dataset in ... JCL & VSAM 7
No new posts JOIN STATEMENT PERFORMANCE. DFSORT/ICETOOL 12
Search our Forums:

Back to Top