 <p>I disagree with the solution suggesting 2 left joins. I think a table-valued function is more appropriate so you don't have all the coalescing and additional joins for each condition you would have.</p> <pre><code>CREATE FUNCTION f_GetData ( @Logic VARCHAR(50) ) RETURNS @Results TABLE ( Content VARCHAR(100) ) AS BEGIN IF @Logic = '1234' INSERT @Results SELECT Content FROM Table_1 ELSE INSERT @Results SELECT Content FROM Table_2 RETURN END GO SELECT * FROM InputTable CROSS APPLY f_GetData(InputTable.Logic) T </code></pre>