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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Outer Join In MS SQL

Status
Not open for further replies.

LaCour

MIS
Jul 15, 2004
53
US
In oracle you can do an outer join by adding a (+) to the field that is not required to have a value. How do you do the same in MS SQL.

Here is an example where clause in oracle that would work:
Where table1.record_id = table2.record_id
and table1.foriegn_key = table3.record_id (+)


Thanks in advance

Blair
 
You can do it like this:

Code:
select * 
from 
  table1 t1
  inner join table2 t2 on t1.record_id = t2.record_id
  left outer join table3 t3 on t1.foreign_key = t3.record_id
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top