AP 01 - Avoid ANSI-89 join syntax

Severity

Warning Warning

Type

Readability

Problem

The ANSI-89 Join syntax of joining tables in the WHERE clause is difficult to read and has been superseded in the ANSI-92 release of the standard by a more readable syntax. In particular, the (+) operator used in Oracle to define Outer Joins can be confusing because its use is not intuitive.

SELECT sc.customerid
      ,sc.customername
      ,sb.buyinggroupname
      ,sb.deliverymethodname
  FROM sales_customers sc
      ,sales_buyinggroups sb
 WHERE sc.buyinggroupid(+)=sb.buyinggroupid

Solution

Only use the ANSI-92 compliant join syntax.

SELECT sc.customerid
      ,sc.customername
      ,sb.buyinggroupname
      ,sb.deliverymethodname
  FROM sales_customers sc
  LEFT
  JOIN sales_buyinggroups sb
    ON sc.buyinggroupid=sb.buyinggroupid

Legitimate use of the anti pattern

None