我在代码中找到了这句话:
$dql
= <<<DQL
SELECT u FROM AppBundle:User u
JOIN u.Roles r
JOIN u.team t
WHERE u.id NOT IN (
SELECT user.id
FROM GameBundle:Goal g
JOIN g.user user
WHERE
g.objective = :objective
)
AND
r.profile = :sales_profile
AND
r.company = :company
AND
u.onlyStatus NOT IN (:status)
DQL;
我不知道如何在NOT IN
句子中查询该查询,请帮助我。
我需要知道:
NOT IN
内的查询返回的内容,(数据类型,等等......)NOT IN
内部查询(是可行的?)答案 0 :(得分:1)
SELECT u FROM AppBundle:User u
JOIN u.Roles r
JOIN u.team t
WHERE u.id NOT IN (
SELECT user.id
FROM GameBundle:Goal g
JOIN g.user user
WHERE
g.objective = :objective
)
这意味着在“目标”表格中吸引不目前拥有'目标'的所有用户。
这是你需要的吗?