bug in generated t-sql when using distinct() and take()?  
Author Message
5letters





PostPosted: LINQ Project General, bug in generated t-sql when using distinct() and take()? Top

the generated t-sql for the dlinq query:

(from i in db.table1 join j in db.table2 on i.pk equals j.fk select i orderby i.rank).Distinct().Take(10)

is

"select top 10 distinct ... from table1, table 2 where..."

which is incorrect as distinct should appear before top in the select clause.




Visual Studio 200810  
 
 
Keith Farmer





PostPosted: LINQ Project General, bug in generated t-sql when using distinct() and take()? Top

I checked our existing unittests, and the we have a test against this one already (though the final query is slightly different than what you suggest). Thank you for pointing it out just in case. :)