title: if else within CTE?
body: <p>I want to execute select statement within CTE based on a codition. something like below</p>
  
  <pre><code>;with CTE_AorB
  (
    if(condition)
      select * from table_A
     else
      select * from table_B
  ),
  CTE_C as
  (
     select * from CTE_AorB // processing is removed
  )
  </code></pre>
  
  <p>But i get error on this. Is it possible to have if else within CTEs? If not is there a work around Or a better approach.</p>
  
  <p>Thanks.</p>