title: Using Linq to get the last N number of rows that have duplicated values in a field
body: <p>Given a database table, a column name <code>C</code>, and a number <code>N</code> larger than 1, how can I get a group of rows with equal values of column <code>C</code> which has at least <code>N</code> rows? If there exists more than one such group, I need to get the group which contains the newest entry (the one with the largest Id).</p>
  
  <p>Is it possible to do this using LINQ to Entities?</p>
  
  <pre><code>Example:
  
  &gt; Id | Mycolumn
  &gt; - - - - - - -  
  &gt; 1 | name55555
  &gt; 2 | name22
  &gt; 3 | name22
  &gt; 4 | name22
  &gt; 5 | name55555
  &gt; 6 | name55555
  &gt; 7 | name1
  
  Primary Key: ID
  OrderBy: ID
  Repeated column: Mycolumn
  </code></pre>
  
  <p>If <code>N = 3</code> and <code>C = Mycolumn</code>, then we need to get rows which have the column <code>MyColumn</code> duplicated at least 3 times. </p>
  
  <p>For the example above, it should return rows 1, 5 and 6, because last index of <code>name55555</code> is <code>6</code>, and last index of <code>name22</code> (which is also repeated 3 times) is <code>4</code>.</p>