Re: Best way to use INNER JOIN?

From: Mark D Powell <Mark.Powell_at_eds.com>
Date: Tue, 3 Jun 2008 10:20:20 -0700 (PDT)
Message-ID: <661497bb-ed6b-4d09-9149-40494c26bc3e@d77g2000hsb.googlegroups.com>


On Jun 3, 4:04 am, radino <rgol..._at_gmail.com> wrote:
> Ask Tom:
> "Natural joins -- a bug waiting to happen.",
> "I strongly, vehemently strongly, discourage the use of this feature
> called natural joins.",
> "To join tables by their column names -- how patently just a bad
> idea",
> "Never never never use this feature."
>
> On Jun 1, 6:58 pm, "harry" <a..._at_abc.com> wrote:
>
>
>
> > Using Oracle 10g
>
> > I've always used this form of inner joins -
>
> >   1.  select BOOKSHELF.Title from BOOKSHELF, BOOK_ORDER where
> > BOOKSHELF.Title = BOOK_ORDER.Title;
>
> > A colleague tells me that I should be using this form (but can't tell me
> > why?) -
>
> >   2.  select Title from BOOKSHELF inner join BOOK_ORDER using (Title);
>
> > There is another way I've seen (but don't like) -
>
> >   3.  select Title from BOOKSHELF natural inner join BOOK_ORDER;
>
> > So, is there any difference between methods 1 and 2? if not is it safe to
> > continue using method 1 then?
>
> > thanks in advance
>
> > harry- Hide quoted text -
>
> - Show quoted text -

I cannot image why the ANSI and ISO SQL committees thought a natural join was a good idea. I am not sure this warning really applies to Harry's question on explict inner join syntax, but the warning about a problem waiting to happen is definitely true.

IMHO -- Mark D Powell -- Received on Tue Jun 03 2008 - 12:20:20 CDT

Original text of this message