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
 SQL Server Development (2000)
 Join Question

Author  Topic 

dowens
Yak Posting Veteran

82 Posts

Posted - 2005-10-27 : 12:21:09
How does the join work with regards to the Vendor?
I've never come across a join where there are multiple ON's for one table see below.


FROM dbo.dw_ProvRegion_EffDt_PhysVendor PV
INNER JOIN
(SELECT PRE.*, BL.CapWthdGL
FROM dw_ProvRegion_EffDt_Capacity PRE,
dw_BusinessLine BL
WHERE PRE.LOB = BL.BusCd) PR ON PV.Provider = PR.Provider COLLATE SQL_Latin1_General_CP1_CI_AS AND
PV.LOB = PR.LOB COLLATE SQL_Latin1_General_CP1_CI_AS AND PV.Region = PR.Region COLLATE SQL_Latin1_General_CP1_CI_AS AND
PV.EffDt = PR.EffDt
RIGHT OUTER JOIN
dw_Physician PH LEFT OUTER JOIN
dw_Physician_ProvSpec PS ON PH.PhID = PS.PhID LEFT OUTER JOIN
dw_Vendor VN ON PV.Provider = VN.VendorNumber ON PR.Provider = PH.PhID LEFT OUTER JOIN
dw_Physician_LOB_PcpAssoc PA ON PH.PhID = PA.PhID

X002548
Not Just a Number

15586 Posts

Posted - 2005-10-27 : 12:27:41
Got DDL, and read the link in the sig....does that even compile/Parse?

Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx
Go to Top of Page

dowens
Yak Posting Veteran

82 Posts

Posted - 2005-10-27 : 12:40:31
Big learning curve here.
The query does work.
Not sure what you mean by read link in the sig....!
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2005-10-27 : 12:59:03
See the hint below?

Read it, and post the additional info asked for.



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx
Go to Top of Page
   

- Advertisement -