

In this visual diagram, the Oracle RIGHT OUTER JOIN returns the shaded area: In some databases, the RIGHT OUTER JOIN keywords are replaced with RIGHT JOIN. The syntax for the Oracle RIGHT OUTER JOIN is: SELECT columns This type of join returns all rows from the RIGHT-hand table specified in the ON condition and only those rows from the other table where the joined fields are equal (join condition is met). Let's look at some data to explain how LEFT OUTER JOINS work:Īnother type of join is called an Oracle RIGHT OUTER JOIN. If a supplier_id value in the suppliers table does not exist in the orders table, all fields in the orders table will display as in the result set. This LEFT OUTER JOIN example would return all rows from the suppliers table and only those rows from the orders table where the joined fields are equal. Here is an example of an Oracle LEFT OUTER JOIN: SELECT suppliers.supplier_id, suppliers.supplier_name, orders.order_date The Oracle LEFT OUTER JOIN would return the all records from table1 and only those records from table2 that intersect with table1. In this visual diagram, the Oracle LEFT OUTER JOIN returns the shaded area: In some databases, the LEFT OUTER JOIN keywords are replaced with LEFT JOIN. The syntax for the Oracle LEFT OUTER JOIN is: SELECT columns This type of 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 (join condition is met). It contains the following data:Īnother type of join is called an Oracle LEFT OUTER JOIN.

We have a table called suppliers with two fields (supplier_id and supplier_name). Let's look at some data to explain how the INNER JOINS work: This Oracle INNER JOIN example would return all rows from the suppliers and orders tables where there is a matching supplier_id value in both the suppliers and orders tables.

ON suppliers.supplier_id = orders.supplier_id Here is an example of an Oracle INNER JOIN: SELECT suppliers.supplier_id, suppliers.supplier_name, orders.order_date The Oracle INNER JOIN would return the records where table1 and table2 intersect. In this visual diagram, the Oracle INNER JOIN returns the shaded area: The syntax for the INNER JOIN in Oracle/PLSQL is: SELECT columns Oracle INNER JOINS return all rows from multiple tables where the join condition is met. Chances are, you've already written a statement that uses an Oracle INNER JOIN.
