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
 General SQL Server Forums
 New to SQL Server Programming
 inner join

Author  Topic 

jcb267
Constraint Violating Yak Guru

291 Posts

Posted - 2012-01-18 : 08:42:39
Hi -

Please help!!

I have an inner join that looks like this:

ClaimLine cl inner join ClaimHeader ch on cl.claimid = ch.claimid.

I need to join this to a memberdemographics table based on memberid. Memberid is not in the claimline table. I would like to alter is to look like this:

claimheader ch inner join claimline cl on ch.claimid = cl.claimid
inner join memberdemographics md on ch.memberid = md.memberid

Is there another way to accomplish this?

Thanks!

JB

X002548
Not Just a Number

15586 Posts

Posted - 2012-01-18 : 09:59:47
Why would you want to?

Maybe Change the Joins in to LEFT JOINS?

Maybe this


SELECT *
FROM claimheader ch
LEFT JOIN claimline cl
ON ch.claimid = cl.claimid
LEFT JOIN memberdemographics md
ON ch.memberid = md.memberid



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


Want to help yourself?

http://msdn.microsoft.com/en-us/library/ms130214.aspx

http://weblogs.sqlteam.com/brettk/

http://brettkaiser.blogspot.com/


Go to Top of Page
   

- Advertisement -