DBAsupport.com Forums - Powered by vBulletin
Results 1 to 3 of 3

Thread: Having problem with join

  1. #1
    Join Date
    Nov 2001
    Location
    Visalia, California
    Posts
    20

    Having problem with join

    select a.xxx,b.yyy from table1 a, table2 b
    where a.xxx(+) = b.yyy;


    The result I want is to pick up all the entries in table1 a even if it doesn't match with table2

  2. #2
    Join Date
    May 2002
    Posts
    2,645
    Note the order of the where clause tables:
    Code:
    SQL> select * from xxx;
    
            ID LOCATION
    ---------- ----------
             1 AAAA
             2 BBB
             3 BBBB
             4 DDDD
    
    SQL> select * from yyy;
    
            ID LOCATION
    ---------- ----------
             1 AAAA
             2 BBB
    
    SQL> select a.id, a.location
      2  from xxx a, yyy b
      3  where b.id = a.id (+);
    
            ID LOCATION
    ---------- ----------
             1 AAAA
             2 BBB
    
    SQL> select a.id, a.location
      2  from xxx a, yyy b
      3  where a.id = b.id (+);
    
            ID LOCATION
    ---------- ----------
             1 AAAA
             2 BBB
             3 BBBB
             4 DDDD

  3. #3
    Join Date
    Nov 2001
    Location
    Visalia, California
    Posts
    20
    Thanks - Great Job

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width