Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MAPPING

Status
Not open for further replies.

Stevennn

Programmer
Apr 4, 2007
52
US
Im mapping two tables, But i got a problem. One table has 400 records the other 120. The final result only 120 record. How can I still have those records show up which are not in the 2nd table but in the 1st (400 records).

I don’t know if its relevant but I’m also using DISTINCT to pull those 400 records from another table.


Thank-you for your HELP!
 
To display not only records that match between the tables but also the rows from Table1 that have no match in Table2, then you use a LEFT OUTER JOIN. The simplest way to make that happen (in Oracle) is the following:
Code:
SELECT <expression-list>
FROM table1, table2
WHERE table1.<join column> = table2.<join column>(+);
The "(+)" operator is what invokes the LEFT OUTER JOIN.

Try it, then let us know your findings.

[santa]Mufasa
(aka Dave of Sandy, Utah, USA)
[I provide low-cost, remote Database Administration services: www.dasages.com]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top