title: Linq-like group by for sql
body: <p>It seems like sql <code>group by</code> is more of aggregate functions (COUNT, MAX, MIN, SUM, AVG).</p>
  
  <pre><code>select count(Id), Country 
  from Customer
  where Country &lt;&gt; 'CountryX'
  group by Country
  </code></pre>
  
  <p>But do we have a linq-like query where we want to return all results grouped by a certain column, E.g. in linq I would do</p>
  
  <pre><code>id | title   | category | email         
  ------------------------------------------
  1  | tname-1 | cat1     | test@example.com
  2  | tname-2 | cat1     | test1@example.com
  3  | tname-3 | cat2     | TEst@example.com
  </code></pre>
  
  <p>linq <code>group-by</code>:</p>
  
  <pre><code>var groupedBy = list.GroupBy(item =&gt; item.Email);
  </code></pre>
  
  <p>or even throw in some comparison</p>
  
  <pre><code>var groupedBy = list.GroupBy(item =&gt; item.Email, StringComparer.OrdinalIgnoreCase);
  </code></pre>
  
  <p>and a result will be something like:</p>
  
  <pre><code>key              | items
  ----------------------------------------------------------------------------------------------
  test@example.com | [{Id :1, Title : "tname-1", category: "cat1", email: "test@example.com" },{Id :3, Title : "tname-3", category: "cat2", email: "TEst@example.com" } ]
  test1@example.com| [{Id :2, Title : "tname-2", category: "cat1", email: "test1@example.com" }]
  </code></pre>
  
  <p>but with sql I would definitely want to return only the subset of the columns, say <code>id</code>, <code>title</code> and <code>email</code>.</p>