How to Work With Left Outer Join in SQL

In this article I am going to explain how to work with outer join.
  • 1598

Introduction

Here I am going to explain what is outer join and why we use outer join. Outer join retrieve data from two or more than two tables same as inner join. Outer join differ from inner join. In outer join, it retrieves all data that satisfy the join condition plus unmatched rows in one or both tables. Outer clause is optional in statement.

There are three types of Outer Join

  • Left Outer Join
  • Right Outer Join
  • Full Outer Join

When we use left outer join to retrieve data it retrieve all rows in result set from the first or left table.

A Statement that create mcninvoices table

inv.jpg

Statements that insert data in mcninvoices table

inv (2).jpg

A Statement that is used to fetch data from mcninvoices table

inv111.jpg

A Statement that create vendors table

ven.jpg

Statements that insert data in vendors table

ven (2).jpg

A Statement that is used to fetch data from vendors table

ven (1).jpg

A Statement that retrieve data from two table using Left Outer Join

Clipboard02.jpg


© 2013 dotNetheaven. All rights reserved.