If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > inner join and outer joins

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-24-09, 11:23
ofilha ofilha is offline
Registered User
 
Join Date: Sep 2008
Posts: 7
inner join and outer joins

I have seen code where the inner join is explicitly used, i also have seen code where the usage is just join.

select * from a
inner join b on a.id=b.id

or

select * from a
join b on a.id=b.id

Can anyone explain what are the differences between these two joins?
Thank you.
Reply With Quote
  #2 (permalink)  
Old 03-24-09, 11:47
przytula_guy przytula_guy is offline
Registered User
 
Join Date: Apr 2006
Location: Belgium
Posts: 1,159
or from taba a,tabb b.. is the same
if not explicit always inner join
__________________
Best Regards, Guy Przytula
Database Software Consultant
DB2 UDB LUW Certified V7-V8-V9-V9.7 DB Admin - Dprop..
Information Server Datastage Certified
http://www.infocura.be
Reply With Quote
  #3 (permalink)  
Old 03-24-09, 12:08
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
the keyword INNER is optional

however, it is always a good idea to write it anyway

same with LEFT JOIN -- the keyword OUTER is optional but i always write it
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On