加入实体并计数不起作用
我正在尝试执行此查询,但出现错误:
select c, count(i) as total
from \Invoice i
join i.client c
GROUP BY i.client
错误:如果不选择至少一个根实体别名,则无法通过标识变量选择实体。
怎么了?我想获取所有客户端实体字段
I 'm trying to execute this query but I get an error:
select c, count(i) as total
from \Invoice i
join i.client c
GROUP BY i.client
Error: Cannot select entity through identification variables without choosing at least one root entity alias.
What is wrong? I want to get all the client entity fields
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你可以尝试这个:
我真的不知道这是否有效,但在 Doctrine1 的 DQL 实现中,这将是正确的方法。
You may try this:
I do not really know if this works but in Doctrine1's DQL implementation this would be the right way to go.