Results 1 to 3 of 3

Thread: Table join

  1. #1
    Join Date
    Jul 2004
    Posts
    268

    Unanswered: Table join

    Hi,

    How to join two tables together if a column in one table has values and the column in another table doesn't have values? There are no other common columns in those two tables. Please help.

  2. #2
    Join Date
    Jan 2004
    Posts
    492
    Use an outer join - the outer join gets all from the first table, and any matching rows from the second table:

    ex:
    Code:
    select *
    from a,b
    where a.id = b.id(+)
    This would get everything from A, and any matches from B.

    Hope this helps - if not, post some data
    Oracle OCPI (Certified Practicing Idiot)

  3. #3
    Join Date
    Dec 2003
    Location
    Oklahoma, USA
    Posts
    354
    You can also do this:

    Code:
    select *
    from a FULL OUTER JOIN b
    ON (a.id = b.id)
    This has the added benefit of showing items in one side or the other that does not have a matching item in the other table.
    JoeB
    save disk space, use smaller fonts

Posting Permissions

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