MSá*_*hez 5 subquery limit dql doctrine-orm
我想做一个DQL查询,如:
$dql = "select p
from AcmeDemoBundle:UserTypeA p
where p.UserTypeB = :id
and (
select top 1 r.boolean
from AcmeDemoBundle:Registry r
)
= true";
Run Code Online (Sandbox Code Playgroud)
但似乎TOP 1它不是doctrine2中的有效函数.
我无法弄清楚如何将子查询的结果限制为一行.
DQL 不支持子查询的限制,也不LIMIT支持OFFSET.
请参阅http://www.doctrine-project.org/jira/browse/DDC-885