title: Use percentile_cont with a "group by" statment in T-SQL
body: <p>I'd like to use the <code>percentile_cont</code> function to get median values in T-SQL. However, I also need to get mean values as well. I'd like to do something like the following:</p>
  
  <pre><code>SELECT  CustomerID ,
      AVG(Expenditure) AS MeanSpend , percentile_cont
      ( .5) WITHIN GROUP(ORDER BY Expenditure) OVER( ) AS MedianSpend
  FROM    Customers
  GROUP BY CustomerID
  </code></pre>
  
  <p>Can this be accomplished? I know I can use the OVER clause to group the <code>percentile_cont</code> results...</p>
  
  <p>but then I'm stuck using two queries, am I not?</p>