DDC-1790: Allow ORDER BY and LIMIT for UPDATE queries #2255

Closed
opened 2026-01-22 13:46:17 +01:00 by admin · 2 comments
Owner

Originally created by @doctrinebot on GitHub (Apr 19, 2012).

Originally assigned to: @beberlei on GitHub.

Jira issue originally created by user themming:

I'm trying to update n-number of rows from a table (ordered by created timestamp) but the update query (built in either DQL or using the query builder) does not support ORDER BY or LIMIT on UPDATE statements.

Is it possible to allow these two clauses in UPDATE statements?

Example DQL is:
UPDATE ICFeederBundle:QueuedLead l SET l.lockId=:lockId WHERE l.lockId IS NULL ORDER BY l.created ASC LIMIT 10

Originally created by @doctrinebot on GitHub (Apr 19, 2012). Originally assigned to: @beberlei on GitHub. Jira issue originally created by user themming: I'm trying to update n-number of rows from a table (ordered by created timestamp) but the update query (built in either DQL or using the query builder) does not support ORDER BY or LIMIT on UPDATE statements. Is it possible to allow these two clauses in UPDATE statements? Example DQL is: UPDATE ICFeederBundle:QueuedLead l SET l.lockId=:lockId WHERE l.lockId IS NULL ORDER BY l.created ASC LIMIT 10
admin added the New Feature label 2026-01-22 13:46:17 +01:00
admin closed this issue 2026-01-22 13:46:19 +01:00
Author
Owner

@doctrinebot commented on GitHub (Apr 19, 2012):

Comment created by @beberlei:

This is mysql specific functionality and therefore cannot be supported in DQL.

@doctrinebot commented on GitHub (Apr 19, 2012): Comment created by @beberlei: This is mysql specific functionality and therefore cannot be supported in DQL.
Author
Owner

@doctrinebot commented on GitHub (Apr 19, 2012):

Issue was closed with resolution "Invalid"

@doctrinebot commented on GitHub (Apr 19, 2012): Issue was closed with resolution "Invalid"
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#2255