Table of Contents

SQL - Left (Outer) Join

About

A “Left Outer” join is interpreted as show me all data from the left table and any matches with the right table.

In some databases LEFT JOIN is called LEFT OUTER JOIN.

Articles Related

Example

table1
(inner set)
table2
(outer set)
Column ID Column ID Column ID_2
A A
B B A
D C C
gerardnico@orcl>select table1.id "ID_table1", table2.id "ID_table2"
  2        FROM table1 LEFT OUTER JOIN table2
  3       ON  table1.id = table2.id;
 
ID_table1  ID_table2
---------- ----------
A          A
B          B
D

All the data from the table1 appears even if for the value D, we don't have any match with the table1.

  • Bookmark "SQL - Left (Outer) Join" at del.icio.us
  • Bookmark "SQL - Left (Outer) Join" at Digg
  • Bookmark "SQL - Left (Outer) Join" at Ask
  • Bookmark "SQL - Left (Outer) Join" at Google
  • Bookmark "SQL - Left (Outer) Join" at StumbleUpon
  • Bookmark "SQL - Left (Outer) Join" at Technorati
  • Bookmark "SQL - Left (Outer) Join" at Live Bookmarks
  • Bookmark "SQL - Left (Outer) Join" at Yahoo! Myweb
  • Bookmark "SQL - Left (Outer) Join" at Facebook
  • Bookmark "SQL - Left (Outer) Join" at Yahoo! Bookmarks
  • Bookmark "SQL - Left (Outer) Join" at Twitter
  • Bookmark "SQL - Left (Outer) Join" at myAOL
 
language/sql/left_outer_join.txt · Last modified: 2011/04/29 11:58 by gerardnico