aspose file tools*
The moose likes JDBC and the fly likes inner join     Vs     outer join Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "inner join     Vs     outer join " Watch "inner join     Vs     outer join " New topic
Author

inner join Vs outer join

kri shan
Ranch Hand

Joined: Apr 08, 2004
Posts: 1378
What is the difference between inner join and outer join ?
James Swan
Ranch Hand

Joined: Jun 26, 2001
Posts: 403
- 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

Joined: Apr 08, 2004
Posts: 1378
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

Joined: May 26, 2003
Posts: 30762
    
156

Kri,



[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: inner join Vs outer join