title: CTE table ...using a CASE Statement to fill it
body: <p>I'm using SQL Server 2012 and trying to run 3 separate statements in a CTE.</p>
  
  <p>Something like:</p>
  
  <pre><code>WITH C1 AS
  (
      if (@Param = 1)
        SELECT Field1, Field2 FROM TableA
      else if (@Param = 2)
        SELECT Field1, Field2 FROM TableB
      else
        SELECT Field1, Field2 FROM TableC
  ),
  C2 AS
    Select xxxxx
  </code></pre>
  
  <p>But it's NOT compiling.   </p>
  
  <p>Is that something possible??</p>