Re: Using Joins

From: <shweta.kaparwan_at_googlemail.com>
Date: Sun, 31 May 2009 02:55:51 -0700 (PDT)
Message-ID: <01451b65-dd79-4355-81f0-6d14894084e8_at_s31g2000vbp.googlegroups.com>



On May 31, 9:40 am, Maxim Demenko <mdeme..._at_gmail.com> wrote:
> shweta.kapar..._at_googlemail.com schrieb:
>
>
>
>
>
> > All,
>
> > I have tables a and b as follows,
>
> > SQL> select * from a
> >   2  /
>
> >          X Y
> > ---------- ------------------------------
> >          1 A1
> >          2 A2
> >          3 A3
> >          4 A4
> >            A99
>
> > SQL> select * from b;
>
> >          X Y
> > ---------- ------------------------------
> >          3 B3
> >          4 B4
> >          5 B5
> >          6 B6
>
> > Query1:
>
> > SQL> select a.x,count(b.x) from a , b where a.x = b.x(+) and a.x is
> > not null group by a.x order by
> > a.x;
>
> >          X COUNT(B.X)
> > ---------- ----------
> >          1          0
> >          2          0
> >          3          1
> >          4          1
>
> > Query2:
>
> > SQL> select a.x,count(b.x) from a LEFT OUTER JOIN b ON a.x = b.x and
> > a.x is not null group by a.x
> > order by a.x;
>
> >          X COUNT(B.X)
> > ---------- ----------
> >          1          0
> >          2          0
> >          3          1
> >          4          1
> >                     0
>
> > Question :
> > Since keyword (+)  can be avoided if we use the ANSI equivalent
> > keyword LEFT OUTER JOIN then why
> > there is a difference in the output    using  using (+) ( query1) and
> > using  LEFT OUTER JOIN (query2) ?
>
> > Regards
>
> Have a look athttp://www.oreillynet.com/pub/a/network/2002/10/01/whatsinacondition....http://structureddata.org/2008/02/18/ansi-outer-joins-and-lateral-views/
>
> Best regards
>
> Maxim
>
> --
> Why make things difficult, when it is possible to make them cryptic
> and totally illogical, with just a little bit more effort?
>
> Aksel Peter Jørgensen- Hide quoted text -
>
> - Show quoted text -

Thanks Maxim. Received on Sun May 31 2009 - 04:55:51 CDT

Original text of this message