Connecting Tech Pros Worldwide Help | Site Map

outer join and inner join

pradeepjain's Avatar
Needs Regular Fix
 
Join Date: Jul 2007
Location: India
Posts: 406
#1: Nov 7 '08
Hii guys,
I might be silly to ask this ques..but seriously i did not understand the outer join and inner join in mysql site.i understood left and right join also.
can some one explain outer and inner join with some basic definition and example plzz..and also unique key.


thanks,
Pradeep
Atli's Avatar
Moderator
 
Join Date: Nov 2006
Location: Iceland
Posts: 3,741
#2: Nov 8 '08

re: outer join and inner join


Hi.

Check out NeoPa's SQL JOINs article in the Access HowTo section.

Even tho it is written for Access, the principles are pretty much the same.

Note, however, that the OUTER JOIN he describes does not work in MySQL.
To simulate that, you could try something like:
Expand|Select|Wrap|Line Numbers
  1. SELECT * FROM a
  2. LEFT JOIN b ON a.id = b.id
  3. UNION 
  4. SELECT * FROM a
  5. RIGHT JOIN b ON a.id = b.id;
  6.  
Reply