mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
DDC-1115: "orderby" doesn't work with "setMaxResults" and "setFirstResult" for sql server 2008 #1397
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @doctrinebot on GitHub (Apr 14, 2011).
Jira issue originally created by user minxuan.guo:
Working for a project use doctrine 2.0.3 and sql server 2008, I have a problem when I use "orderBy" "setFirstResult" and "setMaxResults" together.
my PHP code:
then doctrine2 generate a requet for me:
WITH outer_tbl AS (
SELECT ROW_NUMBER() OVER (
ORDER BY {color:red}i0_.NumImmatriculation{color} ASC
)
AS "doctrine_rownum", *
FROM (
SELECT i0_.NumImmatriculation AS {color:red}NumImmatriculation0 {color}
FROM Individu i0_
)
AS inner_tbl
)
SELECT * FROM outer_tbl WHERE "doctrine_rownum" BETWEEN 201 AND 400
This request doesn't work, because sql server don't understand {color:red}i0_.NumImmatriculation{color} in line 3 which should be replaced by {color:red}NumImmatriculation0 {color}
@doctrinebot commented on GitHub (Apr 17, 2011):
Comment created by @beberlei:
Assigned to Juozas.
@doctrinebot commented on GitHub (Apr 28, 2011):
Comment created by aarondm:
This has also been reported here:
http://www.doctrine-project.org/jira/browse/DBAL-82
Hope this gets looked at! Thanks
@doctrinebot commented on GitHub (Aug 18, 2011):
Comment created by juokaz:
Duplicate of DBAL-82
@doctrinebot commented on GitHub (Aug 18, 2011):
Issue was closed with resolution "Duplicate"