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

outer join

Status
Not open for further replies.

andy22

IS-IT--Management
May 4, 2001
3
DE
Please help
I need to do an outer join on two tables A & B
select * from A, B
where a.1 = a.1
and a.2 = b.2
and a.3 =+ b.3
so that I need to find a match on the first two colums 1 & 2, but the last, 3, is the one that is the outer join column, where if not in b still show me everything in a.
thanks in advance
 
Hi There Andy

You will not be able to do what you want to do in 1 query.

Say you have 2 tables "A" and "B".

select * from A, B
where a.field1 = a.field1
and a.field2 = b.field2

will bring you back all records where Field1 in table "A" = Field1 in table "B" and where Field2 in table "A" = Field2 in table "B".
However when you add the Outer Join the query will get confused as You can't have an equal join and an outer join from Table A to B. You can either see all records in table "A" or only those that or equal to table "B".

Please explain more clearly what data you need to get and I will try to help

Bernadette




 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top