Doctrine 1

MSSQL Server / ODBC: Cannot order by a column aggregate when a limit subquery is required.