Re: Best way to use INNER JOIN?

From: BicycleRepairman <engel.kevin_at_gmail.com>
Date: Tue, 3 Jun 2008 19:32:35 -0700 (PDT)
Message-ID: <370276fd-696b-4ffb-b107-a3bbde33fbaa@x35g2000hsb.googlegroups.com>


On Jun 3, 1:20 pm, Mark D Powell <Mark.Pow..._at_eds.com> wrote:
> 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 --

OP listed natural join as #3 on his list of ways to write the query. Anyway, I think everyone is in violent agreement as to its badness. I'll take some pride in knowing that Tom Kyte also said 'never never never' -- unfortunately, it could easily be a case of unconscious plagiarism. Received on Tue Jun 03 2008 - 21:32:35 CDT

Original text of this message