Friday, September 16, 2011

LinQ gotcha - DISTINCT with ORDER BY

In T-SQL, the position of an <Operator> has no relevance as long as they belong to the same SQL statement. However, in a LinQ statement, one <Operator> could override (more acurately, ignore) another <Operator> ... This is pretty evident when combining DISTINCT and ORDER BY on the same element in a given scenario.

Follow Marco Russo's blog here - with a great example with explanation.

No comments:

Post a Comment