Using Joins

Giganews Newsgroups
Subject: Using Joins
Posted by:  shweta.kaparw…@googlemail.com
Date: Sun, 31 May 2009

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

Replies