Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I use window functions in doctrine 2?

SELECT invoice.id, 
COUNT(slip.id),
SUM(projected_minutes)  OVER (PARTITION BY task.id) AS projected_minutes
FROM invoice
INNER JOIN task ON task.invoice_id = invoice.id
LEFT JOIN slip ON slip.task_id = task.id

The query above is in postgresql, and I want to convert it to DQL, but I cant find any documentation for window functions in DQL, is this natively supported in doctrine or would i have to create a custom dql function for this?

like image 431
Trololololol Avatar asked Mar 26 '13 20:03

Trololololol


1 Answers

There is no support for this vendor specific function in Doctrine. Either create a custom DQL function or use Native SQL.

like image 143
Elnur Abdurrakhimov Avatar answered Nov 15 '22 05:11

Elnur Abdurrakhimov