This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Hi, I'm encountering an issue with an order by clause. When joining the same table twice and ordering on a field of the second table, in the generated sql the order by is on the first table.
this results in the following query: SELECT t2.ValueDateTime AS [t2.ValueDateTime] FROM WGIIMPORTRECORD t0 INNER JOIN WGIIMPORTFIELD t1 ON t0.Id = t1.WgiImportRecordId INNER JOIN WGIIMPORTFIELD t2 ON t0.Id = t2.WgiImportRecordId WHERE (((t0.WgiImportKopId = 1 AND t1.Name = 'BurgerServiceNummer') AND t2.Name = 'jaarmaand') AND t1.ValueNumber = 61864158) ORDER BY t1.ValueDateTime When I reverse the order of the tables in the linq query the order by is on the correct table. It would appear that the order by is always applied on the first table of the type in the linq query. Regards, Arjan |
|
|
Thanks for reporting this. I believe I have tracked down his this can occur so I have added a candidate fix for this and this will be available in the next nightly build. If you continue to have an issue after updating can you please send us through a small repro project which triggers this.
|
|
|
Hi Jeremy, Thanks for the rapid response! Just in case I include a test case with a repro. Regards, Arjan |
|