教义 2.1 - FROM 中的子选择?
阿嗨! 我正在寻找一种在 DQL 中生成这样的查询的方法
SELECT a.allRegistrations, b.allEvents
FROM
( SELECT count(r0.ID) AS allRegistrations
FROM SPRegistration r0 ) a,
( SELECT count(e1.ID) AS allEvents
FROM SPEvent e1 ) b;
,当我尝试在“from”方法中添加子选择之一时,它最终会出现“错误:类'('未定义。”
此查询的替代方法会是......
SELECT
( SELECT count(r0.ID) AS allRegistrations
FROM SPRegistration r0 ) AS allRegistrations;
我对学说很陌生......现在经过几个小时的搜索,我想在这里问是否有人知道如何构建这样的查询。
Ahoi!
im searching for a way to generate a query like this in DQL
SELECT a.allRegistrations, b.allEvents
FROM
( SELECT count(r0.ID) AS allRegistrations
FROM SPRegistration r0 ) a,
( SELECT count(e1.ID) AS allEvents
FROM SPEvent e1 ) b;
when i try to add one of the subselects in the "from" method it ends up with "Error: Class '(' is not defined."
the alternative way for this query would be ....
SELECT
( SELECT count(r0.ID) AS allRegistrations
FROM SPRegistration r0 ) AS allRegistrations;
iam new to doctrine ... now after hours of searching, i want to ask here if someone knows how to build such an query.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
目前实现这一目标的唯一方法是使用:
Currently only way to acomplish that is to use: