Results 1 to 4 of 4

Thread: Table Join

  1. #1
    Join Date
    Dec 2001
    Posts
    4

    Red face Unanswered: Table Join

    I want to join 2 tables . The first one has 30 elements and the second one has max (30) elements but in most cases they are less. I want to join the tables and the result to be 30 rows again and there MUST exists one condition that puts the elements form the second table in the specified row depending on the values of the first table and the remaining cells that has no coresponding elemnt can contain everything...even NULL... PLEASE HELP!!!!

  2. #2
    Join Date
    Jul 2003
    Location
    Atlanta
    Posts
    2

    Re: Table Join

    Look outer join

  3. #3
    Join Date
    Jan 2003
    Posts
    5
    You must use an outer join

    INNER JOIN

    select a.id, b.name
    from a, b
    where b.id = a.id


    OUTER JOIN

    select a.id, b.name
    from a, b
    where b.id (+)= a.id


    Daniel,

  4. #4
    Join Date
    Jul 2003
    Location
    US
    Posts
    314

    Arrow Outer Join

    Supoose you have 2 tables A and B, and B is the one which has lesser amounts of records.

    So you would perform an outer join something like

    select a.field1, b.field1 ... from A, B where a.primarykey = b.primarykey(+)

Posting Permissions

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