Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Re: should one use ANSI join syntax when writing an Oracle application?

Re: should one use ANSI join syntax when writing an Oracle application?

From: Mladen Gogala <mgogala_at_verizon.net>
Date: Tue, 17 Oct 2006 21:02:24 -0400
Message-id: <1161133344l.2809l.1l@medo.noip.com>

On 10/17/2006 09:18:11 AM, Niall Litchfield wrote:
>
> I don't understand what you mean here, my naive example is below, where are
> all the columns involved?
>
> SCOTT @ nl102 >select e.ename,d.dname
> 2 from
> 3 emp e left outer join dept d
> 4 on (e.deptno=d.deptno)
> 5 ;
>
> ENAME DNAME
> ---------- --------------
> MILLER ACCOUNTING
> KING ACCOUNTING
> CLARK ACCOUNTING
> FORD RESEARCH
> ADAMS RESEARCH
> SCOTT RESEARCH
> JONES RESEARCH
> SMITH RESEARCH
> JAMES SALES
> TURNER SALES
> BLAKE SALES
> MARTIN SALES
> WARD SALES
> ALLEN SALES
> LITCHFIELD
>

Niall, fortunately not all joins are outer joins. What bothers me the most are queries like this:

select a,b,c from A left outer join B left outer join C left outer join D or, worse,
select a,b,c from (
select * from A left outer join B left outer join C left outer join D ) where <conditions on a,b and c>;

The latter query will retrieve all columns from the tables A,B,C and D, which can be overwhelming. You are a well known consultant and a respected figure in the database world and you know how to write a good query. Some developers, especially younger developers (pun intended) write lousy queries like the latter one. That is what motivates me for my jihad against ANSI joins.

-- 
Mladen Gogala
http://www.mladen-gogala.com

--
http://www.freelists.org/webpage/oracle-l
Received on Tue Oct 17 2006 - 20:02:24 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US