Oracle Left Outer Join | Left Outer Join - oracle tutorial - sql tutorial
![Oracle left outer join](https://www.wikitechy.com/tutorials/oracle/img/oracle-images/oracle-left-outer-join.gif)
Learn oracle - oracle tutorial - Oracle left outer join - oracle examples - oracle programs
What is Oracle Left outer join ?
- Left outer join returns all rows from the LEFT-hand table specified in the ON condition and only those rows from the other table where the joined fields are equal.
![left outer join](https://www.wikitechy.com/tutorials/oracle/img\oracle-images\left-outerjoin.gif)
Syntax:
SELECT columns
FROM table1
LEFT [OUTER] JOIN table2
ON table1.column = table2.column;
click below button to copy the code. By - oracle tutorial - team
Example:
SELECT wikitechy_employee.id, wikitechy_employee.name, orders.orderid
FROM wikitechy_employee
LEFT OUTER JOIN orders
ON wikitechy_employee.id = orders.id;
click below button to copy the code. By - oracle tutorial - team
Sample Database:
- We have a table called wikitechy_employee with four fields (id, name, position, and city). It contains the following data:
![left outerjoin database](https://www.wikitechy.com/tutorials/oracle/img\oracle-images\left-outerjoin-database.png)
- We have another table called orders with three fields (id, customer_name, and orderid).
![left outerjoin customer database](https://www.wikitechy.com/tutorials/oracle/img\oracle-images\left-outerjoin-cust-table.png)
oracle tutorial , sql tutorial , sql , pl sql tutorial , oracle , pl sql , plsql
Left Outer Join:
![left outerjoin query](https://www.wikitechy.com/tutorials/oracle/img\oracle-images\left-outer-join-query.png)
- This LEFT OUTER JOIN example would return all rows from the wikitechy_employee table and only those rows from the orders table where the joined fields are equal (id from both the tables).
- The rows for Suganya, Venkat and Dharma would be included because a LEFT OUTER JOIN was used. However, you will notice that the orderId field for those records contains a <null> value.
Oracle ALL Joins
![Oracle join query](https://www.wikitechy.com/tutorials/oracle/img\oracle-images\sql-joins-all.gif)
Oracle Join Query - Inner Join Query - Left Outer Join Query - Right Outer Join Query - Full Outer Join Query