wood burning stoves 2.0*
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 Murach's Java Servlets and JSP this week in the Servlets 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: 1371
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: 1371
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
internet detective
Marshal

Joined: May 26, 2003
Posts: 30050
    
149

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
 
Don't get me started about those stupid light bulbs.
 
subject: inner join Vs outer join
 
Similar Threads
default join
join problem in hibernate 3.x
Left Outer Join Vs Left Join
Joining Hashtable-s
What are the joins in Hibernate ?