Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 SQL SRV LEFT OUTER JOIN help

Author  Topic 

scranthdaddy
Starting Member

2 Posts

Posted - 2004-06-04 : 11:01:09
select
BORR.fico as borr1fico,
BORR2.fico as borr2fico,
BORR3.fico as borr3fico
from export EX with (nolock)
inner join borrower BORR with (nolock) on BORR.Id = EX.ApplId
left outer join borrower BORR2 with (nolock) on BORR2.Borr_Id = EX.LoanApplId and BORR2.Borr_Id = '2'
left outer join borrower BORR3 with (nolock) on BORR3.Borr_Id = EX.LoanApplId and BORR3.Borr_Id = '3'
where EX.ApplId = '1234567890'
and BORR.Borr_Id = '1'

Hi, I have a join between the export and borrower table (1:M). I would like to add another outer join
to a borrower_address table from the borrower table, but I am not sure how to accomplish this. An example
of the end result I a looking for would be:
borr1fico borr2fico borr3fico borr1street borr1city borr1state borr2street borr2city borr2state
--------
700 650 800 113 Elm Mpls MN 504 Oak StPaul null

X002548
Not Just a Number

15586 Posts

Posted - 2004-06-04 : 11:09:14
Not sure of the problem...just add it like you have in your example...no?



Brett

8-)
Go to Top of Page

scranthdaddy
Starting Member

2 Posts

Posted - 2004-06-04 : 11:24:19
I originally thought I had to add a join within a join, but now I see I can just add the join to the next line. Thanks.
Go to Top of Page
   

- Advertisement -