[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-7041) SQLServer2005Dialect handles DISTINCT clauses incorrectly

George Gastaldi (JIRA) noreply at atlassian.com
Wed Feb 8 23:22:40 EST 2012


    [ https://hibernate.onjira.com/browse/HHH-7041?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=45437#comment-45437 ] 

George Gastaldi commented on HHH-7041:
--------------------------------------

The Order by clause inside the OVER() statement is wrong also, as http://msdn.microsoft.com/en-us/library/ms189461.aspx states that 

{quote}
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.
{quote}

> SQLServer2005Dialect handles DISTINCT clauses incorrectly 
> ----------------------------------------------------------
>
>                 Key: HHH-7041
>                 URL: https://hibernate.onjira.com/browse/HHH-7041
>             Project: Hibernate ORM
>          Issue Type: Bug
>            Reporter: George Gastaldi
>             Fix For: 4.1.0
>
>
> SQLServer2005Dialect messes with the SQL when 
> Eg: 
> {code:sql}
> select xxx from yyy where yyy.id not in (select distinct(aaa) from bbb)
> {code}
> becomes: 
> {code:sql}
> WITH query AS (select 
>     xxx  
>     from yyy    
>     where
>         yyy.id not in ( select aaa from bbb ) 
> ) SELECT
>     * 
> FROM
>     query 
> WHERE
>     __hibernate_row_nr__ >= ? 
>     AND __hibernate_row_nr__ < ?
> {code}

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list