title: how to use group by a derived table from outside of it
body: <p>why this statement doesnt work? I need to group by a derived table from outside of it, not group by in a derived table. the example below is just a simple sample of my real query. and this doesnt work either</p>
  
  <pre><code>select * from (select Value, Cash, max(Title) as title, [Status] 
  from Campaign.Exchange) as tbl
  group by tbl.Value, tbl.Cash, tbl.Status
  </code></pre>
  
  <p>here is the error : Column 'Campaign.Value' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.</p>