2 left joins in 1 sql

  • Can I do 2 left joins in 1 sql statement?

    select c.*, r.disease new_dis,e.employer_name

    FROM

    dbo.Central_fact_Table c

    left join dbo.Disease_Final_Resolved r

    on r.member_id = c.member_id

    left join dbo.eligibility e on

    e.elig_tag=c.elig_tag

  • Yes.

  • I second that. Yes, you can. I am doing it now in a view I created.

  • You can do as many join as you need to build a query set. However the more work there is to do the slower it can get, so I suggest if you don't need all the joins in every query but there is a set that does get used frequently, make it a view to itself and then join the view to other pieces in the query. Now as far as what you have should work a long as the object match what is in your database, just run it and see what happens.

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply