This week's book giveaway is in the OCAJP forum.
We're giving away four copies of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) and have Khalid A Mughal & Rolf W Rasmussen on-line!
See this thread for details.
Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

inner join Vs outer join

 
kri shan
Ranch Hand
Posts: 1470
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the difference between inner join and outer join ?
 
James Swan
Ranch Hand
Posts: 403
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
- inner joins only returns rows that "match" in both tables
- outer joins return "all" rows from 1st table, and null valued columns in rows that don't exist in the 2nd table

for example, imagine we have this data, also for each query, we join them on column "id":


Also to note, the SQL syntax for outer joins is database vendor specific, Oracle used different notation from say SQL Server.
 
kri shan
Ranch Hand
Posts: 1470
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In Oracle outer join is defined as * symbol. in Sybase outer join is defined as + symbol. What is the outer join symbol for DB2 ?
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34835
369
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Kri,

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic