LEFT OUTER JOIN tableName ON joined columns : Outer Joins Left Right « Table Joins « Oracle PL/SQL Tutorial

Oracle PL/SQL Tutorial
1. Introduction
2. Query Select
3. Set
4. Insert Update Delete
5. Sequences
6. Table
7. Table Joins
8. View
9. Index
10. SQL Data Types
11. Character String Functions
12. Aggregate Functions
13. Date Timestamp Functions
14. Numerical Math Functions
15. Conversion Functions
16. Analytical Functions
17. Miscellaneous Functions
18. Regular Expressions Functions
19. Statistical Functions
20. Linear Regression Functions
21. PL SQL Data Types
22. PL SQL Statements
23. PL SQL Operators
24. PL SQL Programming
25. Cursor
26. Collections
27. Function Procedure Packages
28. Trigger
29. SQL PLUS Session Environment
30. System Tables Data Dictionary
31. System Packages
32. Object Oriented
33. XML
34. Large Objects
35. Transaction
36. User Privilege
Java
Java Tutorial
Java Source Code / Java Documentation
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Oracle PL/SQL Tutorial » Table Joins » Outer Joins Left Right 
7. 4. 11. LEFT OUTER JOIN tableName ON joined columns
SQL>
SQL> CREATE TABLE emps (
  2    emp varchar(30)
  3   ,title    varchar(30)
  4  );

Table created.

SQL>
SQL> INSERT INTO emps VALUES ('Tom','Programmer');

row created.

SQL> INSERT INTO emps VALUES ('Jack','Tester');

row created.

SQL> INSERT INTO emps VALUES ('Mary','Technician');

row created.

SQL>
SQL> CREATE TABLE JobLevel (
  2    title     varchar(30)
  3   ,rank    varchar(30)
  4  );

Table created.

SQL>
SQL> INSERT INTO JobLevel VALUES ('Programmer','Level1');

row created.

SQL> INSERT INTO JobLevel VALUES ('Tester','Level2');

row created.

SQL> INSERT INTO JobLevel VALUES ('Technician','Level3');

row created.

SQL>
SQL> CREATE TABLE salary (
  2    rank     varchar(30)
  3   ,payment  DECIMAL(10,2)
  4  );

Table created.

SQL>
SQL> INSERT INTO salary VALUES ('Level1',2000.00);

row created.

SQL> INSERT INTO salary VALUES ('Level2',3000.00);

row created.

SQL> INSERT INTO salary VALUES ('Level3',5000.00);

row created.

SQL> INSERT INTO salary VALUES ('Level4',6000.00);

row created.

SQL>
SQL> select from emps;



EMP
------------------------------
TITLE
------------------------------
Tom
Programmer

Jack
Tester

Mary
Technician


rows selected.

SQL> select from JobLevel;



TITLE
------------------------------
RANK
------------------------------
Programmer
Level1

Tester
Level2

Technician
Level3

rows selected.

SQL> select from salary;



RANK                               PAYMENT
------------------------------  ----------
Level1                                2000
Level2                                3000
Level3                                5000
Level4                                6000

rows selected.

SQL>
SQL>
SQL> SELECT salary.rank
  2  FROM salary LEFT OUTER JOIN JobLevel ON (salary.rank = JobLevel.rank)
  3  WHERE JobLevel.rank IS NULL;



RANK
------------------------------
Level4


row selected.

SQL>
SQL>
SQL> DROP TABLE emps;

Table dropped.

SQL> DROP TABLE JobLevel;

Table dropped.

SQL> DROP TABLE salary;

Table dropped.

SQL>
SQL>
7. 4. Outer Joins Left Right
7. 4. 1. Understanding Outer Joins
7. 4. 2. Left and Right Outer Joins
7. 4. 3. An Example of a Left Outer Join 1
7. 4. 4. An Example of a Left Outer Join 2
7. 4. 5. An Example of a Right Outer Join 1
7. 4. 6. An Example of a Right Outer Join 2
7. 4. 7. Perform outer joins in combination with self joins, employee and job tables
7. 4. 8. Example outer join with (+)
7. 4. 9. Right outer join with using statement
7. 4. 10. Right outer join with group by
7. 4. 11. LEFT OUTER JOIN tableName ON joined columns
7. 4. 12. LEFT OUTER JOIN vs RIGHT OUTER JOIN
7. 4. 13. Left Outer Join
7. 4. 14. Right Outer Join
7. 4. 15. Right Outer Join(room vs class)
7. 4. 16. Right join with where in clause
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.