title: CASE statement in Join
body: <pre><code>select col1
  from table1
  case when @col2 is null then left outer join else join end
  table2 on (join condition)
  </code></pre>
  
  <p>Above is my query, I want to choose between left outer or right outer join based on 1 condition.</p>
  
  <p>Is there a better solution for implementing the above problem</p>