DDC-2532: Bring back LIMIT in DQL #3173

Closed
opened 2026-01-22 14:14:33 +01:00 by admin · 2 comments
Owner

Originally created by @doctrinebot on GitHub (Jun 27, 2013).

Originally assigned to: @beberlei on GitHub.

Jira issue originally created by user jumika:

Hi!

I want to use limit in dql. Consider the following query:

SELECT p FROM Products p
INNER JOIN p.prices price
WITH price =
(SELECT prc FROM Prices prc
WHERE prc.from < :time
AND prc.product = p
ORDER BY prc.from desc)
WHERE p.id IN(:product_ids)

I want it to use like this:
SELECT p FROM Products p
INNER JOIN p.prices price
WITH price =
(SELECT prc FROM Prices prc
WHERE prc.from < :time
AND prc.product = p
ORDER BY prc.from desc
LIMIT 1)
WHERE p.id IN(:product_ids)

I think it doesn't need further explanation.

Originally created by @doctrinebot on GitHub (Jun 27, 2013). Originally assigned to: @beberlei on GitHub. Jira issue originally created by user jumika: Hi! I want to use limit in dql. Consider the following query: SELECT p FROM Products p INNER JOIN p.prices price WITH price = (SELECT prc FROM Prices prc WHERE prc.from < :time AND prc.product = p ORDER BY prc.from desc) WHERE p.id IN(:product_ids) I want it to use like this: SELECT p FROM Products p INNER JOIN p.prices price WITH price = (SELECT prc FROM Prices prc WHERE prc.from < :time AND prc.product = p ORDER BY prc.from desc LIMIT 1) WHERE p.id IN(:product_ids) I think it doesn't need further explanation.
admin added the Improvement label 2026-01-22 14:14:33 +01:00
admin closed this issue 2026-01-22 14:14:33 +01:00
Author
Owner

@doctrinebot commented on GitHub (Jun 27, 2013):

Comment created by @beberlei:

This impossible to support across all vendors, and therefore not an optoin for us.

@doctrinebot commented on GitHub (Jun 27, 2013): Comment created by @beberlei: This impossible to support across all vendors, and therefore not an optoin for us.
Author
Owner

@doctrinebot commented on GitHub (Jun 27, 2013):

Issue was closed with resolution "Invalid"

@doctrinebot commented on GitHub (Jun 27, 2013): 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#3173