G-3200: Never use an ON clause when USING will work.

Minor

Maintainability

Reason

An on clause requires more code than a using clause and presents a greater possibility for making errors. The using clause is easier to read and maintain.

Note that the using clause prevents the use of a table alias for the join column in any of the other clauses of the sql statement.

Example (bad)

1
2
3
4
5
select e.deparment_id
      ,d.department_name 
      ,e.last_name 
      ,e.first_name 
  from employee e join department d on (e.department_id = d.department_id);

Example (good)

1
2
3
4
5
select   department_id
       d.department_name 
      ,e.last_name 
      ,e.first_name 
  from employee e join department d using (department_id);