SQL Server: Query with limit fails for HQL with ORDER BY over select clause alias

Description

If the HQL like:

is executed with limit and offset, then SQLServer2008Dialect produces SQL like

This fails, as one select clause expression (select ROW_NUMBER() OVER (order by col_1) as _hibernate_row_nr_ refers to another useing col_1 alias.

Environment

MS SQL Server 2008

Status

Assignee

Unassigned

Reporter

Piotr Findeisen

Fix versions

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Major
Configure