Feature Request: PARTITION BY #7364

Open
opened 2026-01-22 15:50:43 +01:00 by admin · 1 comment
Owner

Originally created by @ghost on GitHub (May 7, 2024).

Feature Request

Q A
New Feature yes
RFC no
BC Break no

Summary

Being able to use "PARTITION BY" in $this->createQueryBuilder()->select().

it would help to take away the need to build a workaround for a query that is using this:

SELECT 
    customer_id,
    COUNT(*) OVER (PARTITION BY customer_id) AS order_count_per_customer
FROM 
    Orders;
Originally created by @ghost on GitHub (May 7, 2024). ### Feature Request <!-- Fill in the relevant information below to help triage your issue. --> | Q | A |------------ | ------ | New Feature | yes | RFC | no | BC Break | no #### Summary <!-- Provide a summary of the feature you would like to see implemented. --> Being able to use "PARTITION BY" in $this->createQueryBuilder()->select(). it would help to take away the need to build a workaround for a query that is using this: ```SQL SELECT customer_id, COUNT(*) OVER (PARTITION BY customer_id) AS order_count_per_customer FROM Orders; ```
Author
Owner

@garak commented on GitHub (May 7, 2024):

I support that, but I think it should be more general and include broader support for window functions.
I see that this was already proposed and rejected in #6175 but maybe it should be reconsidered now.

By the way, all the DBMSs supported by doctrine/dbal have now support for window functions, which are not "vendor-specific" (like mentioned in the issue above)

@garak commented on GitHub (May 7, 2024): I support that, but I think it should be more general and include broader support for window functions. I see that this was already proposed and rejected in #6175 but maybe it should be reconsidered now. By the way, all the DBMSs supported by doctrine/dbal have now support for window functions, which are not "vendor-specific" (like mentioned in the issue above)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#7364