title: Unknown column 'Project2.Name' in 'where clause'
body: <p>I have a simple statement to get data from my mySQL database but it get the following error:</p>
  
  <blockquote>
    <p>[MySqlException (0x80004005): Unknown column 'Project2.Name' in 'where
    clause']    MySql.Data.MySqlClient.MySqlStream.ReadPacket() +272<br>
    MySql.Data.MySqlClient.NativeDriver.GetResult(Int32&amp; affectedRow,
    Int64&amp; insertedId) +68<br>
    MySql.Data.MySqlClient.Driver.GetResult(Int32 statementId, Int32&amp;
    affectedRows, Int64&amp; insertedId) +17<br>
    MySql.Data.MySqlClient.Driver.NextResult(Int32 statementId, Boolean
    force) +110    MySql.Data.MySqlClient.MySqlDataReader.NextResult()
    +761    MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior
    behavior) +1557<br>
    MySql.Data.Entity.EFMySqlCommand.ExecuteDbDataReader(CommandBehavior
    behavior) +33<br>
    System.Data.Common.DbCommand.ExecuteReader(CommandBehavior behavior)
    +12    System.Data.EntityClient.EntityCommandDefinition.ExecuteStoreCommands(EntityCommand
    entityCommand, CommandBehavior behavior) +435</p>
  </blockquote>
  
  <p>The Statement:</p>
  
  <pre><code>using (myEntities ctx = new myEntities())
  {
      var Result = ctx.Items.Where(x =&gt; x.Contact.Country == Country)
                  .GroupBy(p =&gt; p.Name).Where(x =&gt; !x.Any(y =&gt; y.Value == "X"))
  
                  .Select(g =&gt; g.OrderByDescending(p =&gt; p.Date).FirstOrDefault()) //&lt;- Error
                  .Select(g =&gt; g.FirstOrDefault()) // &lt;- no Error
  
                  .ToList();
  }
  </code></pre>
  
  <p>When I use the first <code>Select</code> I get this error, with the second, the code is working fine. Anyone knows the reason?</p>
  
  <p>Same Error found <a href="https://stackoverflow.com/a/19174418/1315444">here</a></p>
  
  <p>I'm using .NET Connector 6.7.4 so it <a href="http://dev.mysql.com/doc/relnotes/connector-net/en/connector-net-news-6-7-4.html" rel="nofollow noreferrer">can't</a> be bug <a href="http://bugs.mysql.com/bug.php?id=68513" rel="nofollow noreferrer">#68513</a></p>