Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: should one use ANSI join syntax when writing an Oracle application?
On 10/17/06, Mladen Gogala <mgogala_at_verizon.net> wrote:
>
>
> On 10/17/2006 01:43:14 AM, Niall Litchfield wrote:
> > My personal preference is for the ANSI standard syntax, I really find
> that
> > seperating out the joins from the other conditions helps me understand
> more
> > easily what a query is trying to achieve. It also helps debugging IMO.
>
> How, exactly are joins different, in your opinion?
it seems to me that where emp.deptno = dept.deptno is an entirely different fish from where emp.deptno=10, in the former case you are saying how employees and departments are related, in the latter you are specifying what criteria you are using to choose data.
>
> >
> > So I'd say that by and large my experience has been positive and that I
> find
> > the style a lot easier to understand.
>
> SQL is modeled after naive set theory. The most basic goal of SQL is to
> help users
> define what to select from where. SQL can be described as "Venn diagrams
> meet spreadsheets".
> In order to achieve that, one should specify columns being selected and
> conditions that
> must be met in order for the row to qualify for the desired subset. My
> greatest beef with
> ANSI joins is precisely the fact that all the columns from both tables are
> included in the
> join.
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
That's ok there's always analytic functions that are a cunning plan to make SQL amazingly efficient and unreadable all at once :)
-- Niall Litchfield Oracle DBA http://www.orawin.info -- http://www.freelists.org/webpage/oracle-lReceived on Tue Oct 17 2006 - 08:18:11 CDT
![]() |
![]() |