我需要将以下代码转换为教义,但似乎找不到正确的 Doctrine2 函数。
Select
ProductName,
WeekNumber,
sum(sale)
from
(
SELECT
ProductName,
DATEDIFF(week, '2011-05-30', date) AS WeekNumber,
sale
FROM table
)
GROUP BY
ProductName,
WeekNumber
谢谢
我需要将以下代码转换为教义,但似乎找不到正确的 Doctrine2 函数。
Select
ProductName,
WeekNumber,
sum(sale)
from
(
SELECT
ProductName,
DATEDIFF(week, '2011-05-30', date) AS WeekNumber,
sale
FROM table
)
GROUP BY
ProductName,
WeekNumber
谢谢
Doctrine 2 ORM 不支持FROM
子句中的子查询。子查询唯一允许的位置是WHERE
和HAVING
子句,它们受到各种 RDBMS 供应商的支持。
请检查DQL的完整EBNF