How to create LEFT JOIN with SELECT subquery using QueryBuilder in Doctrine 2?(如何在 Doctrine 2 中使用 QueryBuilder 创建带有 SELECT 子查询的 LEFT JOIN?)
问题描述
我需要限制 LEFT JOIN 结果,所以我必须使用子查询.有人可以给我建议我如何使用 Doctrine 2 做到这一点?
I need to limit LEFT JOIN results, so I must use subquery. Could somebody give me advice how can I do it with Doctrine 2?
我现在拥有的是:
但我必须更改它以将每个类别的工作结果限制为 10 个.
but I must change it to limit jobs results to 10 by every category.
推荐答案
不幸的是,这是不可能的.在这里:
Unfortunately, This is not possible. Per here:
https://groups.google.com/forum/#!topic/doctrine-user/0rNbXlD0E_8
你可以在这里使用 IN:
You can do it using IN here:
在 Doctrine 2 中执行 WHERE .. IN 子查询
这篇关于如何在 Doctrine 2 中使用 QueryBuilder 创建带有 SELECT 子查询的 LEFT JOIN?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!