Home Forums SQL Server 2008 T-SQL (SS2K8) AVOID JOINING ON TO THE SAME TABLE MULTIPLE TIMES? RE: AVOID JOINING ON TO THE SAME TABLE MULTIPLE TIMES?

  • Thanks guys...

    My select * was just an example. I was actually selecting using a coalesce - COALESCE( C.ClassName_FD, C2.ClassName_FD, '' ) etc. Basically getting the class from the join where there is an airline first and then the join with no airline next.

    I can use an inner join with the "OR" however I get duplicate rows in my query - it seems to return once with the airline and again without the airline.

    I was hoping there could be a way to wrap the two class_tb joins using a "(SELECT.." or some sort of derived table then with my table joins after this I would only need to join onto Class_TB once as opposed to joining on to Class_TB with the airline and Class_TB without airline.

    Hope that makes sense...