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!

Left Outer Joins with Restrictions on Outer Table

Status
Not open for further replies.

Luvsql

Technical User
Apr 3, 2003
1,179
CA
Table 1

Order No Item Qty
12345 X 25
12345 Y 20
98765 X 5


Table 2

Order No Item Qty
76522 X 2
76522 Y 3
56789 X 4

I need to join Table 1 to Table 2 on Item and only for OrderNo=12345 from Table 1 and 76522 on Table 2. If I do a left outer join from Table 1 to Table 2, if I enter a restriction on Table 2, it changes it to an equal join.
 
in your select statement you will have
tabel2.field = x

change to
(isnull(tabel2.field) or tabel2.field = x)

Ian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top