SQLServer2005Dialect handles DISTINCT clauses incorrectly
Description
Activity

George GastaldiFebruary 9, 2012 at 6:40 AM
The bug commented above was created in

George GastaldiFebruary 9, 2012 at 6:27 AM
Steve, can you apply the fix in https://github.com/hibernate/hibernate-orm/pull/270 before launching this release ?
Steve EbersoleFebruary 9, 2012 at 6:21 AM
Closing for 4.1 release

George GastaldiFebruary 9, 2012 at 6:20 AMEdited
The Order by clause inside the OVER() statement is wrong also, as http://msdn.microsoft.com/en-us/library/ms189461.aspx states that
When used in the context of a ranking window function, <ORDER BY Clause> can only refer to columns made available by the FROM clause. An integer cannot be specified to represent the position of the name or alias of a column in the select list. <ORDER BY Clause> cannot be used with aggregate window functions.
This fix is NOT on the previous pull request

George GastaldiFebruary 9, 2012 at 6:17 AM
Another Pull Request coming: https://github.com/hibernate/hibernate-orm/pull/270
Fixed
Details
Details
Details
Created February 8, 2012 at 10:11 PM
Updated February 9, 2012 at 6:40 AM
Resolved February 9, 2012 at 2:55 AM
SQLServer2005Dialect messes with the SQL when
Eg:
becomes: