A.1 Old Inner Join Syntax

   

The following example illustrates the older inner join syntax:

SELECT d.name, l.regional_group FROM department d, location l WHERE d.location_id = l.location_id;

The corresponding query with the new syntax is:

SELECT d.name, l.regional_group FROM department d JOIN location l ON d.location_id = l.location_id;

Following are the two differences between the old and the new inner join syntax:

  • The old syntax separates tables in the FROM clause using a comma.

  • The old syntax specifies the join condition in the WHERE clause.

Since the old syntax uses the WHERE clause to specify the join condition as well as filter conditions, it may take awhile for you to figure out which component of the WHERE clause is a join condition, and which component is a filter condition.



Mastering Oracle SQL
Mastering Oracle SQL, 2nd Edition
ISBN: 0596006322
EAN: 2147483647
Year: 2003
Pages: 154

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net