如何在 Doctrine 中改变这个sql。分组依据 ROLLUP
modifier不受 Doctrine 支持。
SELECT `users`.`username`,`owner`.`name`,`property`.`name`,SUM(`expenses`.`price`)
FROM `users`
INNER JOIN `owner`ON `users`.`id`=`owner`.`user_id`
INNER JOIN `property`ON `owner`.`id`=`property`.`owner_id`
LEFT JOIN `expenses`ON `property`.`id`=`expenses`.`property_id`
GROUP BY `property`.`id`,`expenses`.`id`with rollup
最佳答案
看来你运气不好:
Because
WITH ROLLUP
is aGROUP BY
modifier, it cannot be solved with a custom function. You'll have to use native SQL for this.
正如 Jasper N. Brouwer 在 doctrine user group 上指出的那样.
关于mysql - 如何在 Doctrine 中使用汇总修饰符进行分组?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35087321/