Good advice, Frank provides.
The need for dynamic SQL grows strong, when database is poorly designed! Resist, for this leads to the dark side!
Joins, conditional they should not be. If lookup value is not required, do it anyway you shall ! Confuse not returning columns A,B,C in a resultset, with showing columns A,B and C on a report! Return them all you might, but show them all the client may not!
To confuse presentation with data, a fast path to the darkest regions of the force!
Should all lookups not match, LEFT OUTER JOINs you will produce! Should conditions determine from which other table to assign to a column, a CASE statement you shall use!
All are powerful tools of the jedi ...